maybe this is a little better

This commit is contained in:
nek0 2017-08-04 07:05:04 +02:00
parent a6a30a7705
commit 866d85945c

View file

@ -73,10 +73,9 @@ transferForm = areq currencyField (bfs MsgValue) (Just 0)
notify :: User -> User -> Int -> App -> IO () notify :: User -> User -> Int -> App -> IO ()
notify sender rcpt amount master = do notify sender rcpt amount master = do
case userEmail sender of when (isJust $ userEmail sender) $
Just email -> liftIO $ sendMail (fromJust $ userEmail sender) "Guthabentransfer beim Matematen"
liftIO $ sendMail email "Guthabentransfer beim Matematen" [stext|
[stext|
Hallo #{userIdent sender} Hallo #{userIdent sender}
Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} an #{userIdent rcpt} transferiert. Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} an #{userIdent rcpt} transferiert.
@ -84,13 +83,10 @@ Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} an
Viele Grüße, Viele Grüße,
Dein Matemat Dein Matemat
|] |]
Nothing -> when (isJust $ userEmail rcpt) $
return () liftIO $ sendMail (fromJust $ userEmail rcpt) "Guthabentransfer eingetroffen"
case userEmail rcpt of [stext|
Just email ->
liftIO $ sendMail email "Guthabentransfer eingetroffen"
[stext|
Hallo #{userIdent rcpt} Hallo #{userIdent rcpt}
Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} von #{userIdent sender} erhalten. Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} von #{userIdent sender} erhalten.
@ -98,6 +94,4 @@ Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} vo
Viele Grüße, Viele Grüße,
Dein Matemat Dein Matemat
|] |]
Nothing ->
return ()