2

We have 2 Email Services each having separate Email Addresses created in Full Copy Sandbox. As Email Addresses are to be manually created(and not deployable) we created Email Addresses for these 2 Email Services manually in prod. If our Full Copy Sandbox is refreshed (from Prod), will the existing Email Addresses in Full Copy Sandbox be overwritten with that of Prod Email Addresses? or the Email Addresses in Full Copy Sandbox get deleted in refresh process? If so, please let me know if there is any way to retain the already existing Email Addresses in Sandboxes from overwriting/deletion as part of sandbox refresh?

Thanks

  • Are you referring to email-to-case service? – Jayant Das Aug 27 '18 at 18:34
  • No Jayant, this is about Email Addresses under Email Services. – Suha Aug 28 '18 at 5:20
  • Okay, so you have a custom apex email service created for an apex and that you have an email address specified in there, right? – Jayant Das Aug 28 '18 at 5:28
  • Yes, we have created Email Service and associated it with an Email Address. We have an Apex class which defines the logic when the Email Address receives emails. The logic is working fine in sandbox. We have created Email Service and Email Address in manually(as Email Services cannot be deployed using ant etc) and the Email Address in sandbox and prod are different. Query is, when sandbox refresh happens, will the Email Address in sandbox gets overridden with that of prod or it gets deleted? .Also would like to know if there is a way to retain the sandbox Email address even after refresh. – Suha Aug 28 '18 at 6:12
  • I can say if it was for Email-to-Case. I would imagine the same for Apex Email Services too, because while creating an email in there, the domain is created by Salesforce automatically. I can think that that during refresh it won't be retained because anything in the sandbox will be deleted and then refreshed from Production. And any custom email addresses in email service will most likely not be copied from Production either and that it needs to be created again. I don't see any docs for this, only way to verify will be to test it – Jayant Das Aug 28 '18 at 12:40
0

Rolling up the comments and providing more details on the automation part.

I can say if it was for Email-to-Case. I would imagine the same for Apex Email Services too, because while creating an email in there, the domain is created by Salesforce automatically. I can think that that during refresh it won't be retained because anything in the sandbox will be deleted and then refreshed from Production. And any custom email addresses in email service will most likely not be copied from Production either and that it needs to be created again. I don't see any docs for this, only way to verify will be to test it

That you have confirmed the aforementioned behavior after a refresh, that even custom Email Services are not retained and that you need to create it after a refresh, confirms the understanding.


For automating creation of the Email Addresses in the Email Services, you can actually utilize the EmailServicesFunction available with Metadata API. Refer to details on EmailServicesAddress in the documentation link, where you can create an EmailServiceAddress records. These are the records which represents all the email addresses configured in the system (including standard email to case as well as I observed). Utilizing this API is what you need here for your automation.

Hope this helps.

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.