You need to sign in to do that
Don't have an account?
Trigger on Email Template sent to Contact
One of my marketing users would like a trigger set up for when she sends out a specific email using a template. Is this possible? I apologize if this is a repeat question. I tried searching on the topic, but all I found where questions about creating triggers that send email.
Here is our basic scenario. SF User sends an email to a SF contact, inviting them to use our e-commerce site. When the email is sent, a trigger should fire that assigns a contact role of 'E-Commerce Admin' to the contact for their account.
Does anyone know if I can do that? Any help would be greatly appreciated.
Thanks!
David
Unfortunately not, or not really anyway -- you could write a trigger on Task (which is what the email will become) but the Task will not retain any memory of what email template it came from.
Alternately, you could make a custom button that calls an Apex webservice that sends the email and then stamps the appropriate info on the Contact. That's not exactly a trigger but it would accomplish the goal.
Thank you for your response. The user wants the update to happen when she bulk emails contacts rather than a button to send one at a time.
You can equally make your button do a bulk email (or, say, put it on a list view so she can select multiple contacts and email them all). Regardless, though, the button itself or its underlying Apex will have to run the logic; there's no trigger you can make that will work for this.