test(i18n): failed attempts to use i18nHamletFile for mail notifications
This commit is contained in:
parent
1ed47e677b
commit
a755bd0be6
@ -4,6 +4,7 @@ module Handler.Utils.Mail
|
|||||||
, userMailT
|
, userMailT
|
||||||
, addFileDB
|
, addFileDB
|
||||||
, addHtmlMarkdownAlternatives
|
, addHtmlMarkdownAlternatives
|
||||||
|
, addHtmlMarkdownAlternatives'
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Import
|
import Import
|
||||||
@ -120,3 +121,28 @@ addHtmlMarkdownAlternatives html' = do
|
|||||||
writerOptions = markdownWriterOptions
|
writerOptions = markdownWriterOptions
|
||||||
{ P.writerReferenceLinks = True
|
{ P.writerReferenceLinks = True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{-
|
||||||
|
addHtmlMarkdownAlternatives' :: ( HandlerSite m ~ UniWorX
|
||||||
|
, MonadMail m
|
||||||
|
, ToMailPart (HandlerSite m) Html
|
||||||
|
, ToMailHtml (HandlerSite m) a
|
||||||
|
) => a -> m ()
|
||||||
|
addHtmlMarkdownAlternatives' = addHtmlMarkdownAlternatives
|
||||||
|
-}
|
||||||
|
|
||||||
|
-- For now failed attempt to use with i18nHaletFile or widgets:
|
||||||
|
addHtmlMarkdownAlternatives' :: ( HandlerSite m ~ UniWorX
|
||||||
|
, MonadMail m
|
||||||
|
, YesodMail (HandlerSite m)
|
||||||
|
) => Html -> m ()
|
||||||
|
addHtmlMarkdownAlternatives' html = do
|
||||||
|
markdown <- runMaybeT $ renderMarkdownWith htmlReaderOptions writerOptions html
|
||||||
|
|
||||||
|
addAlternatives $ do
|
||||||
|
providePreferredAlternative html
|
||||||
|
whenIsJust markdown provideAlternative
|
||||||
|
where
|
||||||
|
writerOptions = markdownWriterOptions
|
||||||
|
{ P.writerReferenceLinks = True
|
||||||
|
}
|
||||||
|
|||||||
@ -53,10 +53,13 @@ dispatchNotificationQualificationRenewal nQualification jRecipient = do
|
|||||||
setSubjectI $ MsgMailSubjectQualificationRenewal qname
|
setSubjectI $ MsgMailSubjectQualificationRenewal qname
|
||||||
|
|
||||||
editNotifications <- mkEditNotifications jRecipient -- TODO: add to hamlet file again
|
editNotifications <- mkEditNotifications jRecipient -- TODO: add to hamlet file again
|
||||||
-- addHtmlMarkdownAlternatives $(i18nWidgetFile "qualification/renewal")
|
-- let msgrenewal = $(i18nHamletFile "qualification/renewal") -- :: HtmlUrlI18n (SomeMessage UniWorX) (Route UniWorX)
|
||||||
|
-- addHtmlMarkdownAlternatives' msgrenewal
|
||||||
|
|
||||||
-- TODO: this is just a dummy to continue while i18nHamletFile usage is unclear
|
-- TODO: this is just a dummy to continue while i18nHamletFile usage is unclear
|
||||||
addHtmlMarkdownAlternatives $(ihamletFile "templates/mail/qualificationRenewal.hamlet")
|
addHtmlMarkdownAlternatives $(ihamletFile "templates/mail/qualificationRenewal.hamlet")
|
||||||
|
|
||||||
|
|
||||||
| otherwise -> do
|
| otherwise -> do
|
||||||
let _letterHead = error "TODO"
|
let _letterHead = error "TODO"
|
||||||
-- makePDF "pdflatex" [] writer woptions pandoc
|
-- makePDF "pdflatex" [] writer woptions pandoc
|
||||||
|
|||||||
@ -23,4 +23,8 @@ $newline never
|
|||||||
#{show qualificationUserValidUntil}
|
#{show qualificationUserValidUntil}
|
||||||
#{show qualificationUserFirstHeld}
|
#{show qualificationUserFirstHeld}
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<h3>
|
||||||
|
EXPIRY
|
||||||
|
TODO: Diese Nachricht muss noch überarbeitet werden.
|
||||||
^{ihamletSomeMessage editNotifications}
|
^{ihamletSomeMessage editNotifications}
|
||||||
|
|||||||
@ -36,7 +36,6 @@ $newline never
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<h3>
|
<h3>
|
||||||
Test
|
RENEWAL
|
||||||
content
|
TODO: Diese Nachricht muss noch überarbeitet werden.
|
||||||
|
|
||||||
^{ihamletSomeMessage editNotifications}
|
^{ihamletSomeMessage editNotifications}
|
||||||
|
|||||||
Reference in New Issue
Block a user