function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ErikOSnet0ErikOSnet0 

Need to scrub contact emails for testing with email templates

I have a process that notifies the Contacts of Accounts that match a query.  I created the ability to run in test mode where it scrubs the email address before sending, adding it to the toAddresses.  That works.  But, this needs to use a template. 

 

The template requires a targetObjectId.  Unfortunately, this uses the real email address of the Contact rather than the scrubbed one. Does anyone know of a way to use a supplied email address rather than the email of the Contact record without changing the underlying value in the database?  

 

 

ErikOSnet0ErikOSnet0

BUMP...  we need to test this process with our customers in production as we only have one shot to get this right when we go to initiate the real customer communications.  Given the governor limits, dev testing is not enough.  It is critical that we are able to scrub the email addresses for testing with our production data and remedy issues before doing the real communication.