applyCreatedDirToRemote :: Path -> ApiAction (Change, RemoteFile)
applyCreatedDirToRemote dirPath = do
    --For now Digipost only support one level of folders
    let folderName = takeFileName . takeDirectory . filePath $ dirPath
    (manager, aToken, csrfToken, mbox) <- ask
    createFolderLink <- liftIO $ linkOrException "create_folder" $ DP.mailboxLinks mbox
    newFolder <- liftResourceT $ createFolder aToken manager createFolderLink csrfToken folderName
    let dir = Dir dirPath
    return (Created dir, RemoteDir dir newFolder)
applyCreatedDirToRemote :: Path -> ApiAction (Change, RemoteFile)
applyCreatedDirToRemote dirPath = do
    --For now Digipost only support one level of folders
    let folderName = takeFileName . takeDirectory . filePath $ dirPath
    (manager, aToken, csrfToken, mbox) <- ask
    createFolderLink <- liftIO $ linkOrException "create_folder" $ DP.mailboxLinks mbox
    newFolder <- liftResourceT $ createFolder aToken manager createFolderLink csrfToken folderName
    let dir = Dir dirPath
    return (Created dir, RemoteDir dir newFolder)
applyCreatedDirToRemote dirPath = do
    --For now Digipost only support one level of folders
    let folderName = takeFileName . takeDirectory . filePath $ dirPath
    (manager, aToken, csrfToken, mbox) <- ask
    createFolderLink <- liftIO $ linkOrException "create_folder" $ DP.mailboxLinks mbox
    newFolder <- liftResourceT $ createFolder aToken manager createFolderLink csrfToken folderName
    let dir = Dir dirPath
    return (Created dir, RemoteDir dir newFolder)