In my environment, when someone registers for an Event, an Attendee record is generated. I have successfully created a process in Process Builder that sends an email when an Attendee record is generated and it fits certain criteria (when the Event is of certain types). I have also successfully tested that the Visualforce of the email populates as desired when I "Send Test and Verify Merge Fields," and am able to select the "Related To Record" manually. (Full disclosure: I want to pull from the Event the user has registered for.)
However, when I run a test registration, there seems to be a problem with the email that gets sent: none of the merge fields are populated. The contact/email address isn't part of the problem--the email gets delivered where it should. (I'm thinking that is because it is on the Attendee record.) How can I make sure that the content of the email gets associated with the correct Event record?
Here is the beginning of the code I have tried using:
<messaging:emailTemplate subject="You Are Registered!" recipientType="Contact" relatedToType="EventApi__Event__c">
<messaging:plainTextEmailBody >
Hello!
Thank you for registering for our {!relatedTo.EventApi__Display_Name__c}.