Token support in email body works fine, but it would be nice to have token support in email subject as well (e.g. to use the contact form subject field there).

Comments

Paul Broon created an issue. See original summary.

broon’s picture

Parent issue: #2826441: Token support »
scott_euser’s picture

Hi Paul,

This one should be quite straightforward, just the settings form and service class need updating and should just be a copy paste job. I'm happy if you prefer to submit a patch or wait for me to add this one likely later this week or early next. No preference.

Thanks,
Scott

broon’s picture

Status: Active » Needs review
StatusFileSize
new1.42 KB

Here's a patch. But do we need two tokenizeX() functions. Cold we refactor both into a single function?

scott_euser’s picture

StatusFileSize
new3.53 KB
new4.33 KB

Looks good! I've just made a couple tweaks:

  • explained in the settings page that tokens can be used for subject as well
  • added the token validation to the subject
  • ensure subject is rendered as plain text (as far as I understand email subject must be plain text, d8 core has a useful class to handle that)
  • refactored as you suggested

  • scott_euser committed 467a129 on 8.x-1.x
    Issue #2833736 by scott_euser, Paul Broon: Add token support for email...
scott_euser’s picture

Version: 8.x-1.5 » 8.x-1.6
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.