2

I am using Symfony 5 and the mailer component with twig templating. The context works fine for the body of the email, but is there not a way to apply that to the email subject line also?

Right now I'm having to manually do my own string replace, which I just can't believe this isn't possible within the same message context.

yivi
  • 42,438
  • 18
  • 116
  • 138
Rob Irvin
  • 111
  • 2
  • 9

1 Answers1

0

The subject of the email is not a Twig template, so it won't interpolate any variables from the template context.

You'll need to do your own interpolation when creating the actual email message and setting an email subject.

yivi
  • 42,438
  • 18
  • 116
  • 138