7

Time and time again another user creates or refreshes a sandbox and I cannot log into it.

I use my credentials from production, but a verification code is sent to the "myemail=gmail.com@example.com" address, which of course I can never access.

Does anyone know of a way to prevent this from happening? I am sick of having to ask the person creating the sandbox to change my email manually.

6

Have a look at the SandboxPostCopy Interface. It should be possible to have Apex run after the Sandbox is created and then modify the specific User records email address fields.

  • I haven't tried this in practice. If the email addresses are modified to @example before this runs then it should help. Of course, if the emails are modified after then it isn't going to work. – Daniel Ballinger Aug 13 '17 at 23:54
  • 2
    We're actually going to be experimenting with that this week. In theory it should work... – sfdcfox Aug 14 '17 at 0:11
  • @sfdcfox Let us know how it works out and if the affected users get notifications of the email address change. – Daniel Ballinger Aug 14 '17 at 0:24
  • Wow. What a ridiculously complex workaround for what should be simple. – SFDC Neuf Aug 14 '17 at 21:55
  • 1
    @DanielBallinger my thoughts exactly about DX - it's going to hopefully eliminate a lot more headaches than just this. – SFDC Neuf Aug 15 '17 at 20:05
3

Instead of relying on the email address (which is "munged" during the sandbox copy), you can use your mobile number and self-verify in the sandbox with a text message. To do so, edit your User record in your production org, and put your cell number in the "mobile" field.

Sandboxes created after that point will properly copy your mobile number. When you log into sandboxes for the first time, you will be given the option to self-verify by receiving a text message to your phone number.

1

If your OK with using an IDE and your profile settings allow it, you can always download the file "Security.settings", part of the Security metadata type and add your IP address in as a trusted IP. You can then login via the browser without the verification code and change your email address to the correct one.

An example of an ExactTarget range is below - just copy/paste and add your own ip in for start/end ranges.

     <ipRanges>
        <description>ExactTarget</description>
        <end>206.246.157.6</end>
        <start>206.246.157.1</start>
    </ipRanges>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.