We have an email service set up with the basic code as per the docs.
My Email Service looks like:
global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, Messaging.InboundEnvelope envelope)
{
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
...
do a bunch of stuff
...
result.success = true;
result.message = emailObj.Id;
return result;
}
My understanding is if the result.successs == false
, an email is sent to the sender with the result.message
as the body.
What we're seeing is the sender is always receiving an email, even though it's impossible for the success to be false.
This is happening in both a sandbox and production.
Has anyone come across this before? Is there a known solution?
NOTE: I've ruled out a workflow/process builder as the cause of this email by adding some text to the result.message
.