altered album share email

This commit is contained in:
nek0 2014-12-08 06:26:11 +01:00
parent 0a253aa955
commit 38ade0ad60

View file

@ -63,17 +63,21 @@ postAlbumSettingsR albumId = do
oldShares <- return (L.sort $ albumShares album) oldShares <- return (L.sort $ albumShares album)
case newShares /= oldShares of case newShares /= oldShares of
True -> do True -> do
link <- ($ AlbumR albumId) <$> getUrlRender
rcptIds <- return $ L.nub $ newShares L.\\ oldShares rcptIds <- return $ L.nub $ newShares L.\\ oldShares
rcptMails <- mapM (\uId -> do mapM (\uId -> do
user <- runDB $ getJust uId user <- runDB $ getJust uId
return $ userEmail user addr <- return $ userEmail user
) rcptIds sendMail addr "A new album was shared with you" $
mapM (\addr -> sendMail addr "A new album was shared with you" $
[shamlet| [shamlet|
<h1>Hi there! <h1>Hello #{userSlug user}!
#{ownerName} was so kind to share his album #{albumTitle album} with you. <p>#{ownerName} was so kind to share his album #{albumTitle album} with you.
<p>You can find it
<a href=#{link}>
here
.
|] |]
) rcptMails ) rcptIds
False -> do False -> do
return [()] return [()]
-- nothing to do here -- nothing to do here