I saw that with the release of Winter 21, you can now use Lightning Email Templates in flows and processes via email alerts.
I have had a process setup for about a year that automatically sends a notification to the account owner when a customer (contact) is given permission to an external portal that we have, but I have always just manually sent the email to the contact using a Lightning Email Template. Never had a problem.
When I added the email template to the email alerts and then added the email alert to the process, though, I keep getting an email stating:
Error Message: core.email.template.TemplateRenderingException: We don't recognize the field prefix Recipient. Associate a record that matches the prefix or update the template to remove the merge field from the body, subject, or letterhead.
I've done some digging around the Trailblazer community to see if I could find a solution on this, but everything i've seen says the issue stems from not using the correct merge field language, but this does not make sense, as my template does have the {{{--}}} format that it requires, and it notes that recipient will replace contact. I have also noticed that this only happens when I try to use the process to send the email, not if I do it manually.
I am at a loss to figure this out, and would greatly appreciate any thoughts on what could be causing this.
Hi Frédéric,
In your "Send Email" action, what have you set for 'Recipient ID'? If you are using an Email Template in the "Send Email" action, a 'Recipient ID' is required. Depending on what object your flow is based on, if it's running on contact, or lead, you might just need {!$Record.Id} for your Recipient ID. I've got mine working on a custom object, so there is a Contact lookup field on my custom object called 'Teacher' so my Recipient ID on the Send Email action is set to {!$Record.Teacher__r.Id}
With the correct Recipient ID in place, you can then start to use merge field on your Email Template, such as {{Recipient.FirstName}} etc. Also, on the Lightning Email Template, it's worth noting that I've only used two {{ }} brackets around my {{Recipient.FirstName}} in the merge fields, but on the same email template, all other record merge fields are 3 brackets {{{merge_field}}} and everything works perfectly.
Hope this helps.
Thanks,
Neil