Sunday, June 15, 2014

How to get the Salesforce Org Wide Address ID?

How to get the Salesforce Org Wide Address ID?

We can get the Org Wide Address ID Using ‘Organization Wide Address’  Salesforce Object. below is the Sample Apex Class

Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
for(OrgWideEmailAddress owa : [select id, Address, DisplayName from OrgWideEmailAddress]) {
if(owa.Address.contains('TBR')) {
email.setOrgWideEmailAddressId(owa.id);
}
}







0 comments:

Post a Comment

 
| ,