You need to sign in to do that
Don't have an account?
cloudSavvyProg
Email not sent from Trigger.
I have a custom object trigger that has a logic of sending emails to ids based on criteria. It uses email template and org wide address.
So when the record is inserted, the trigger should send emails. I am not recieving any emails. Any idea how to solve this?
The code is as follows.
Messaging.SingleEmailMessage mail = Messaging.renderStoredEmailTemplate(emailtemplate.Id, UserInfo.getUserId(), record.Id);
List<string> toAddress = new List<string>{"valid address"};
mail.setToAddresses(toAddress);
mail.setSubject('test');
mail.setOrgWideEmailAddressId(owa.Id);
mail.setSaveAsActivity(false);
mail.setUseSignature(false);
allmsg.add(mail);
Messaging.sendEmail(allmsg,false);
The above code is in @future method.
Not receiving any emails? how to resolve this? is there any configuration needs to made in SF?
So when the record is inserted, the trigger should send emails. I am not recieving any emails. Any idea how to solve this?
The code is as follows.
Messaging.SingleEmailMessage mail = Messaging.renderStoredEmailTemplate(emailtemplate.Id, UserInfo.getUserId(), record.Id);
List<string> toAddress = new List<string>{"valid address"};
mail.setToAddresses(toAddress);
mail.setSubject('test');
mail.setOrgWideEmailAddressId(owa.Id);
mail.setSaveAsActivity(false);
mail.setUseSignature(false);
allmsg.add(mail);
Messaging.sendEmail(allmsg,false);
The above code is in @future method.
Not receiving any emails? how to resolve this? is there any configuration needs to made in SF?
Did you check the "Deliverability" option under "Email Administration"?