I am using tokens inside emails such as the Registration Reminder email. These tokens come from custom fields I have added to the registration process on the Event Series entity, which can contain full HTML. Specifically, I have a field custom_registration_reminder
that I place inside the Registration Reminder email as a token [eventseries:custom_registration_reminder]
. This is so event organizers can place a unique registration reminder inside the reminder emails.
My Registration Reminder email set on /admin/structure/events/registrant/settings looks like this:
This is a reminder for your event.
[eventseries:custom_registration_reminder]
I am using Mime Mail module to send emails from my site in HTML format.
When Registration Reminder emails arrive, the HTML from the [eventseries:custom_registration_reminder] token is visible inside the email, not being translated into HTML. For example:
This is a reminder for your event.<p>Custom message should be here.</p>
I would like these emails to parse the HTML from the token.
Add a custom "Text, (formatted, long)" field to the Event Series entity.
Have the content from that field print out in the Registration Reminder email set at /admin/structure/events/registrant/settings
Create an Event Series with content in the new field.
Trigger the Registration Reminder email to be sent and see that the HTML is not formatted properly.
I have success getting the formatting correct by changing code inside parseTokenizedString() in NotificationService.php and using Token::replacePlain() instead of Token::replace()
return $this->token->replace($this->token->replace($string, $data), $data);
to:
$tokenized_data = $this->token->replacePlain($string, $data);
return $this->token->replacePlain($tokenized_data, $data);
I am not sure that this has no repercussions elsewhere. Or maybe my case is very unique. Any advice is appreciated.
Needs review
2.0
Recurring Events Registration (Submodule)
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.