You need to sign in to do that
Don't have an account?

Visualforce templates are not currently supported for mass email
I tried to test sending mass emails using following test code
sited form Visualforce Manual.
But failed to have received an error message.
Any suggestion appreciated.
In case of sending a singlemassage test,it was OK.
Error Message:-
System.EmailException:
SendEmail failed. First exception on row 0;
first error: INVALID_ID_FIELD,
Visualforce templates are not currently supported for mass email.: []
Test Code:-
User you = [ SELECT Email
FROM User
WHERE Id = :UserInfo.getUserId()
LIMIT 1 ];
EmailTemplate template = [ SELECT Id
FROM EmailTemplate
WHERE DeveloperName = 'Test_Template'
LIMIT 1 ];
Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
mail.templateId = template.Id;
mail.targetObjectIds = new Id[] { you.Id };
mail.setSaveAsActivity(false);
Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
You can not use Visualforce email templates with Mass Emails, they are only available with SingleEmails
All Answers
You can not use Visualforce email templates with Mass Emails, they are only available with SingleEmails
Thanks!
This is described in the wizard as creating a mail template.
You can bypass this limitation using a custom field + a workflow email alert + dataloader :
On your target object :
This technique works with merge fields and also allows you to bypass the limit of 500 emails / day / organization
Hey, I am working on same problem.
What did you mean by below?
load an update on these records (sendemail = true) with the dataloader : all updated records will receive your visualforce email
Thanks,
You just need to perform an update on the record you want to send the email to, in order to trigger the workflow rule and thus, senf the email alert attached to it.
You can do it manually one by one, but for a large number of record, the dalaloader will allow you to mass update records by loading a CSV file.
interesting. do you know if there is a limit with this route? does the update have to be made by the data loader or can i update mass recrods from a trigger and still get the emails to send? thanks for your time...