Skip to content

Instantly share code, notes, and snippets.

@jsullivanlive
Created April 22, 2020 09:05
Show Gist options
  • Save jsullivanlive/5a6081e34cd93d6ca9c68adc980cdd82 to your computer and use it in GitHub Desktop.
Save jsullivanlive/5a6081e34cd93d6ca9c68adc980cdd82 to your computer and use it in GitHub Desktop.
fix appexchange sandbox emails.txt
/* scheduled hourly */
List<Lead> leads = [
select Id, Email
from Lead
where IsConverted = false
and Email like '%=%@%example.com'
limit 100
];
for (Lead l : leads) {
String e = l.Email;
e = e.replace('@example.com', '');
e = e.replace('=', '@');
System.debug(l.Email + ' => ' + e);
l.Email = e;
}
//update leads;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment