I’d like to call some functions that live inside Application.Helper.Controller
and use ?context :: ControllerContext
. Here’s a simplified version:
module Web.Mail.Users.Confirmation where
import Web.View.Prelude
import IHP.MailPrelude
data ConfirmationMail = ConfirmationMail { user :: User }
instance BuildMail ConfirmationMail where
subject = "Subject"
to ConfirmationMail { .. } = Address { addressName = Just "F L", addressEmail = "fname.lname@example.com" }
from = "hi@example.com"
html ConfirmationMail { .. } = [hsx|
Hello World
<a href={redirectExample}>View link</a>
|]
where
redirectExample :: (?context :: ControllerContext) => Text
redirectExample = urlTo PostsAction
This results with an error: