Skip to main content

Outbound (Chatter)

Portal configuration

Before you proceed to the Portal part, you need to create a deterministic tokenization function in Salesforce org. Once it is completed, you can proceed to the Portal part.

Setting up Email Relay (Outbound messages) in Salesforce

To manage and reply to email messages from Salesforce, you need to set up an email relay in Salesforce. Please follow the instructions for each step.

Adding an email relay

  1. From Setup, select Email, then select Email Delivery Settings, finally, click Email Relays.

  2. On the list with email relays, click Create Email Relay.

  3. Configure the email relay as follows:

    • Host - enter the address of Border that you received when created an email gateway on Portal. It should look like se-proxy-mt-01.incountry.io.

    • Port - enter the SMTP port that you received when created an email gateway on Portal. It should be 587.

    • TLS Setting - select the Required Verify option.

    • Enable SMTP Auth - check the box to enable SMTP authentication.

    • Auth Type - select the Auth Plain option.

    • Username - enter the Client ID from the Email Gateway integration.

    • Password - enter the Client Secret from the Email Gateway integration and re-enter it in the Confirm Password box.

  4. Click Save.

Setting up organization-wide addresses

  1. From Setup, select Email, then click Organization-Wide Addresses.

  2. Click Add.

  3. Fill out the following fields:

    • Display Name - specify the name from which emails are sent.

    • Email Address - specify the email address from which emails are sent to recipients (case creators).

  4. Choose the user profile for this email address. When sending email from Salesforce, users with these profiles can select this organization-wide email address from which the email will be sent (the From field).

  5. Click Save.

Upon completion of this step, a verification email will be delivered to your mailbox.

Setting up email domain filters

  1. From Setup, select Email, then select Email Delivery Settings, finally, click Email Domain Filters.

  2. Click Create Email Domain Filter.

  3. Enter the following information:

    • Sender Domain - enter the domain from the email box. For example: alicloud.zhaoerxing.top

    • Recipient Domain - leave the * (asterisk) sign as-is

    • Email Relay - select the email relay that you have created.

    • Active - check the box to activate the email domain filter.

  4. Click Save.

Configuring email deliverability

  1. From Setup, select Email, then click Deliverability.

  2. Clear the Activate bounce management box.

  3. Clear the Enable compliance with standard email security mechanisms box.

  4. Click Save.

note

Once the configuration is complete, the inbound emails will be redacted and saved to the InCountry platform. You can use the following InCountry web components to pull this data from the InCountry platform:

For the details on adding the web components that will render the redacted cases, please check our documentation.

Additional functionality

The InCountry Data Residency for Salesforce package provides functionality allowing you to use merge fields (placeholders) in email templates. This feature gives you more flexibility to customize your business logic.

Merge-fields template

Replace the following template: %profile_key={0},{1}% WHERE {0} - recordId, {1} - fieldApiName %profile_key={0},{1}% => %profile_key=006jkdsa00123oLpo,FirstName%

Code sample:

{
"from": "john.doe@mail.com",
"to": "jane.doe@mail.com",
"subject": "Hello, %profile_key=006jkdsa00123oLpo,FirstName%! Personal discount update notification",
"text": "Hello, %profile_key=006jkdsa00123oLpo,FirstName%! \n Your current discount is %profile_key=006jkdsa00000oLpo,Amount%! test"
}

ToAddress field template

Replace the following template: Email@pk-{0}.{1} WHERE {0} - recordId, {1} - country of EmailMessage record Email@pk-{0}.{1} => Email@pk-0035w00003r5wdOAAQ.se

Code sample:

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
List<String> toAddresses = new List<String>{'Email@pk-0035w00003r5wdOAAQ.se'};

mail.setToAddresses(toAddresses);
mail.setOrgWideEmailAddressId('0D25w000000H2aPCAS');
mail.setSubject('%profile_key=0035w00003r5wdOAAQ, Title%');
mail.setPlainTextBody('Hello, %profile_key=0035w00003r5wdOAAQ,FirstName% %profile_key=0035w00003r5wdOAAQ,LastName%!');

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });