0

I recently created an email service In my production org. The email service creates contacts from emails sent to the service address.

The handler works when I send it emails from my company email, but not from my personal email. I see nothing in the debug logs when sending from my personal email.

Why is this? What settings do i need to flip to allow external email handling?

note: Org Deliverability is set to ALL.

Inbound Email Handler

global class genericEmail2SalesforceHandler implements Messaging.InboundEmailHandler {
  global Messaging.InboundEmailResult handleInboundEmail(
    Messaging.InboundEmail email,
    Messaging.InboundEnvelope envelope
  ) {
    System.debug(email);

    Map<String, Object> inputs = new Map<String, Object>();
    inputs.put('toAddress', email.toAddresses);
    inputs.put('email', email.fromAddress);
    inputs.put('fromName', email.fromName);
    inputs.put('messageBody', email.plainTextBody);
    inputs.put('subject', email.subject);

    Flow.Interview.Email2Salesforce_Handler myFlow = new Flow.Interview.Email2Salesforce_Handler(
      inputs
    );
    myFlow.start();

    Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
    return result;
  }
}

Email Service Email Service

1 Answer 1

0

This ended up being an easy fix.

Both the email service & email service address have a field "Accept Email From."

In this scenario I was filtering emails out at the address level by accident.

To fix I:

  1. i opened email services in setup.
  2. clicked edit on the email address for the service
  3. cleared out "Accept Emails From"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .