Tuesday, 20 August 2013

ActionMailer body string interpolation not printing value of variables, is printing exact string

ActionMailer body string interpolation not printing value of variables, is
printing exact string

I have a mailer that looks like (@user and @foo are passed to the
containing method):
mail(to: @user.email, subject: 'Foo is expired',
body: 'Your Foo reservation for #{@foo.bar.name} in position
#{@foo.position}
has expired. Please recreate the reservation if necessary')
I'm testing it with some puts, puts mail.body looks like:
'Your Foo reservation for #{@foo.bar.name} in position #{@foo.position}
has expired. Please recreate the reservation if necessary'
Am I just mistaken on how I'm doing interpolation? Has it something to do
with ActionMailer, or outputting text to console?
Thanks.

No comments:

Post a Comment