How to mass Confirm Email Address in Salesforce?

1. Create Bounced Email report in Salesforce.


2. Use Dataloader or execute the below code in Developer Console.

  1. List < Lead > listLeads = [ SELECT Id, EMAILBOUNCEDDate   
  2.                               FROM Lead   
  3.                              WHERE EMAILBOUNCEDREASON = '550 5.7.1 Relaying denied' AND EMAILBOUNCEDDate = YESTERDAY   
  4.                              LIMIT 300 ] ;  
  5. for ( Lead obj : listLeads ) {  
  6.       
  7.     obj.EMAILBOUNCEDDate = null;  
  8.     obj.EMAILBOUNCEDREASON = null;  
  9.       
  10. }  
  11. update listLeads;  

Note:
Update the report filter and SOQL filter accordingly.


No comments:

Post a Comment