From cd5999ac35c4bd8252ee0254775c4f9368f5b349 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 3 Sep 2019 14:33:46 -0400 Subject: [PATCH] Make simpler email template It doesn't distinguish between lead and rest of content --- backend/Rhyolite/Backend/Email.hs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/backend/Rhyolite/Backend/Email.hs b/backend/Rhyolite/Backend/Email.hs index f61a2206..34a1f2eb 100644 --- a/backend/Rhyolite/Backend/Email.hs +++ b/backend/Rhyolite/Backend/Email.hs @@ -108,7 +108,16 @@ sendEmailFrom name' email recipients sub body = deriveNewtypePersistBackend (\m -> [t| EmailT $m |]) (\m -> [t| ReaderT EmailEnv $m |]) 'EmailT 'unEmailT emailTemplate :: (MonadRoute r m, Default r) => Text -> Maybe Html -> Html -> Html -> Html -> m Html -emailTemplate productName mStyleHtml titleHtml leadHtml contentHtml = do +emailTemplate productName mStyleHtml titleHtml leadHtml contentHtml = + emailTemplateSimple productName mStyleHtml titleHtml $ H.table $ do + H.tr $ H.td $ H.h1 titleHtml + H.hr + H.tr $ H.td $ H.p ! class_ "lead" $ leadHtml + H.hr + H.tr $ H.td $ contentHtml + +emailTemplateSimple :: (MonadRoute r m, Default r) => Text -> Maybe Html -> Html -> Html -> m Html +emailTemplateSimple productName mStyleHtml titleHtml contentHtml = do indexLink <- routeToUrl def return $ H.docTypeHtml $ do H.head $ do @@ -117,12 +126,7 @@ emailTemplate productName mStyleHtml titleHtml leadHtml contentHtml = do Just styleHtml -> styleHtml H.title titleHtml H.body $ H.table $ do - H.tr $ H.td $ H.table $ do - H.tr $ H.td $ H.h1 titleHtml - H.hr - H.tr $ H.td $ H.p ! class_ "lead" $ leadHtml - H.hr - H.tr $ H.td $ contentHtml + H.tr $ H.td $ contentHtml H.tr $ H.td $ H.table $ H.tr $ H.td $ do H.hr H.p $ do