Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Salesforce adds @example.com to users emails after sandbox refresh. This post script reverts the email addresses.

License

Notifications You must be signed in to change notification settings

douglascayers/sfdc-revert-user-emails-sandbox-post-copy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Revert User Emails on Sandbox Post Copy

Salesforce adds @example.com or .invalid to users emails after sandbox refresh (why?). This post script reverts the email addresses.

Deploy to Salesforce

Inspiration

This project was inspired by Beth Breisnes who asked on Twitter if someone had a Sandbox Post Copy script that would fix users' emails in a sandbox.

Viability

I put together a simple proof-of-concept and test class that shows how to mass update all the users' email addresses. However, I have not tested this in a real sandbox. One concern is whether Salesforce will send an "email change verification" to all the users before the change takes effect as is protocol when changing user's emails via Setup. If yes then you likely spammed all your users -- that may or may not be what you were going for.

Email Change Verification

Daniel Peter shared a thread on Salesforce StackExchange about how some folks try to by-pass their users having to click the verification link themselves, which may or may not be applicable for Sandbox Post Copy (I'm just not sure!).

Disable Email Change Verification

If email change verification is a problem (I'm not sure yet, I've not tested this in a real sandbox) and you still want to use this technique then you could contact Salesforce Support and request that the verification step be disabled.

About

Salesforce adds @example.com to users emails after sandbox refresh. This post script reverts the email addresses.

Resources

License

Stars

Watchers

Forks

Languages