In order to unpack a Widget, you need to use widgetToPageContent. However, that's probably not what you want, since I doubt you intend to have CSS and Javascript in the email. Instead, you probably want to use hamletFile
, which can generate just HTML. You'll need to pass in a URL rendering function, which you can get with getUrlRenderParams
. The incantation will look something like:
renderer <- getUrlRenderer
let html = $(hamletFile "filepath.hamlet") renderer