I have created an Email Service Function which looks something like below:
<?xml version="1.0" encoding="UTF-8"?>
<EmailServicesFunction xmlns="http://soap.sforce.com/2006/04/metadata">
<apexClass>XXXEmailHandler</apexClass>
<attachmentOption>None</attachmentOption>
<authenticationFailureAction>Discard</authenticationFailureAction>
<authorizationFailureAction>Discard</authorizationFailureAction>
<emailServicesAddresses>
<authorizedSenders>google.com</authorizedSenders>
<developerName>XXX</developerName>
<isActive>true</isActive>
<localPart>xxxemailservice</localPart>
<runAsUser>[email protected]</runAsUser>
</emailServicesAddresses>
<functionInactiveAction>Discard</functionInactiveAction>
<functionName>XXXEmailService</functionName>
<isActive>true</isActive>
<isAuthenticationRequired>false</isAuthenticationRequired>
<isErrorRoutingEnabled>false</isErrorRoutingEnabled>
<isTextAttachmentsAsBinary>false</isTextAttachmentsAsBinary>
<isTlsRequired>false</isTlsRequired>
<overLimitAction>Discard</overLimitAction>
</EmailServicesFunction>
As you see, there is a username provided for the value runAsUser
.
Now when I try to deploy this metadata in another org, it gives an error below:
In field: Username - no User named [email protected] found
How can I deploy this metadata file, or what should I change in this file so that this can be deployed in any instance?