I am trying to pass a link that contains variables to a mailer model. For such a simple email, I’d rather not use liquid.
controller:
...
@token = @user.authentication_token
link = "<a href='http://www.mysite.com/?token=<%= @token %>' >Click here</a>"
UserMailer.deliver_reminder(@user, @link)
model:
def reminder(user, link)
recipients user.email
from "service@mysite.com"
subject "link"
body "Go here: " + link
end
here’s the way the link gets sent in the email:
<a href='https://www.mysite.com/?token=<%= @token %>' >Click here</a>
thanks!
Using regular string interpolation:
Using string concatenation: