Hello Everyone
I stumbled across a squite painful problem.
I built a skuidpage which calls a apex to send mails upon buttonclick. It all works perfectly fine in Sandbox, but we pushed it to a live org and it just plain out fails
i get this error in the console:
the Apex looks as follows:
public class SendMailsToParticipants{
@InvocableMethod
static void SendMails(List<string> emails) {
static void SendMails(List emails) {
String eventId = recipients[0];
Event e = [SELECT id FROM Event WHERE id = :eventId];
recipients.remove(0);
List<messaging.singleemailmessage> mailList = new List<messaging.singleemailmessage>();
for(String recipient : recipients){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();mail.setTemplateId([select id from EmailTemplate where developername='EventUpdatedEmail'].id);mail.setTargetObjectId([SELECT id FROM User WHERE id = :recipient].id);mail.saveAsActivity = false;mail.setWhatId(e.id);mailList.add(mail);
}
Messaging.sendEmail(mailList);
}
} String recipients = emails.get(0).split(‘,’);</messaging.singleemailmessage></messaging.singleemailmessage>
i can’t figure out why its failing, the users have rights and i use the exat same data to test on live as on sandbox
Any ideas?