You need to sign in to do that
Don't have an account?
TheSFDeveloper
Email Alert and Trigger
Hi Experts,
I have created one Email Alert "TestEmailAlert" which is having
1. e-mail template
2. recipients e-mail address.
Now I am creating a new Trigger on my custom object for the event before_insert and before_update and if certain condition gets satisfied then i want to use Email Alert "TestEmailAlert" which i have created above into my Trigger to send an email to the targeted users.
Right now we are not sure how to call Email Alert within Trigger.
Any help would be appreciated !!
Thank You,
Hi Again,
Thanks for the suggestions.
I have gone through the docs which you have provided and in this case i have to select the number of users ID to whom i have to send an email along with the email template.
And what i am looking for is: CALL EMAIL ALERT FROM TRIGGER
The main benefit of calling EMAIL ALERT from Trigger is, I do not need to select the user's ID and Template ID inside the trigger as it is been already defined in the EMAIL ALERT.
Please let us know your thoughts.
Thank You,
Vishal
Message Edited by werewolf on 05-26-2008 09:56 AM
You mean to say, below sample code is not possible from trigger?
trigger sendEmailTesting on Custom_Object__c (after insert,after update) {
for (Custom_Object__c newCustomObject : Trigger.new)
{
if(newCustomObject[0].PRODUCT_TYPE == 'ABC')
{
EmailAlert Ea = new EmailAlert();
Ea.setID = '121121'
Ea.send();
}
}
}
Okie.
Let me give a try :)
Thanks for all your suggestions.
Can someone please help me in disabling the trigger on SalesForce.com production environment.
Thanks in advance,
Vishal