You need to sign in to do that
Don't have an account?
send email via different email templates to campaign members in apex
Hi,
In Campaign Object, I have 1 Field - Email template. In a Batch, I am processing a list of campaignMembers(from different Campaigns)
to send them an email with specified template. I am using Messaging.MassEmailMessage and hence froth no Loop for Emails.
Problem:
Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
mail.setTargetObjectIds(LeadIds);
mail.setTemplateId('00X30000001fOKk');
Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
mail.setTargetObjectIds(ContactIds);
mail.setTemplateId('00X30000001fOKk');
Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
This is currently taking Hard-Coded value.What I need is it for every campaignMembers record it should check the campaign's Email Template Field & sends the email using that specified Email Template. Loop does not works ! :-(
Any help/approach would be highly appreciated.
Thanks
Gautam
In Campaign Object, I have 1 Field - Email template. In a Batch, I am processing a list of campaignMembers(from different Campaigns)
to send them an email with specified template. I am using Messaging.MassEmailMessage and hence froth no Loop for Emails.
Problem:
Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
mail.setTargetObjectIds(LeadIds);
mail.setTemplateId('00X30000001fOKk');
Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
mail.setTargetObjectIds(ContactIds);
mail.setTemplateId('00X30000001fOKk');
Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
This is currently taking Hard-Coded value.What I need is it for every campaignMembers record it should check the campaign's Email Template Field & sends the email using that specified Email Template. Loop does not works ! :-(
Any help/approach would be highly appreciated.
Thanks
Gautam
With Salesforce campaign, you don’t have to be an HTML expert to create stunning, professional emails – in fact, you don’t need to know how to code at all. our MassMailer campaign is simple to use and has a Salesforce-friendly interface that you will feel comfortable using right out of the gate. Create your emails, send them immediately, or schedule them to launch at a later date and time. With MassMailer, you have the power.
Say Hello to MassMailer and Say Goodbye to Salesforce Limitations.
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000005uxj5EAA (http://https://appexchange.salesforce.com/listingDetail?listingId=a0N30000005uxj5EAA)
Do you want to know more details please click here https://goo.gl/e0RtSm
Regards
Venu E