Skip to main content
Version: 1.25

Dryad Mailer Setup

This article walks through installing Dryad Mailer, which sends receipt emails through Amazon Simple Email Service (SES) and records what happens to them in Salesforce.

Some steps are done in Amazon and some in Salesforce, and the last step goes back to Amazon. To decide whether you need Dryad Mailer, and to learn how it works, see Email Setup.

The names below, such as "dryad-mailer-tracking", are suggestions. If you use different names, use them consistently in every step. Contact Dryad if you would like help with any of these steps.

Steps in Amazon​

If you don't have an Amazon AWS account yet, go to aws.amazon.com, click Create account, and follow the steps to create a root user. Then continue below.

Choose a Region​

Choose the Amazon region you want to use, and keep your region selected in the top right menu of the Amazon console for every step. Save its region code for later. For example:

RegionRegion code
Canada (Central)ca-central-1
US East (N. Virginia)us-east-1
US East (Ohio)us-east-2

Verify Your Sender Address​

  1. From the main menu, select Amazon Simple Email Service.
  2. In the left menu, select Identities, and click Create identity.
  3. Add your sending domain or email address, and follow Amazon's steps to verify it.

Every address that sends receipts must be verified, including the Receipt Sender Email of each Receipting Account if you use them.

New Amazon SES accounts can only email verified addresses

Request production access in Amazon SES before emailing donors.

Create an SNS Topic​

  1. From the main menu, select Simple Notification Service.
  2. In the left menu, select Topics.
  3. Click Create topic.
  4. Set Type to "Standard".
  5. Set Name to "ses-event-notifications".
  6. Click Create topic.

Create an SES Configuration Set​

  1. From the main menu, select Amazon Simple Email Service.
  2. In the left menu, select Configuration sets.
  3. Click Create set.
  4. Set Configuration set name to "dryad-mailer-tracking", and save this name for later.
  5. Click Create set.

Add an Event Destination​

  1. Click your new "dryad-mailer-tracking" set.
  2. Select the Event destinations tab.
  3. Click Add destination.
  4. Under Sending and delivery, select Sends, Deliveries, Hard bounces and Complaints.
  5. Under Open and click tracking, select Opens and Clicks.
  6. Click Next.
  7. Under Destination options, select Amazon SNS.
  8. Set Name to "dryad-mailer-tracking-destination".
  9. Set SNS topic to "ses-event-notifications".
  10. Click Next, then Add destination.

Create a User​

  1. From the main menu, select IAM.
  2. In the left menu, select Users.
  3. Click Create user.
  4. Set User name to "Dryad Mailer".
  5. Click Next.
  6. Under Permission options, select Attach policies directly.
  7. Under Permissions policies, search for "SES".
  8. Select AmazonSESFullAccess, and click Next.
  9. Click Add permissions.
  10. Click the "Dryad Mailer" user.
  11. Under Access key 1, click Create access key.
  12. Select Application running outside AWS.
  13. Set Description tag value to "dryad-mailer".
  14. Click Download .csv file and save the file in a secure location. You need the access key and secret access key later.
  15. Click Done.

The next steps are done in Salesforce. You return to Amazon at the end.

Steps in Salesforce​

Update the Principal with Access Keys​

  1. Go to Setup > Security > Named Credentials.
  2. Click the External Credentials tab.
  3. Select "dryad__Amazon_SES_EC".
  4. Under Principals, click the down button and then Edit.
  5. Set Access Key to your Amazon access key from Create a User.
  6. Set Access Secret to your Amazon secret access key.
  7. Click Save.

Set Your Region​

The External Credential "dryad__Amazon_SES_EC" and the Named Credential "dryad__Amazon_SES_NC" come with Dryad Receipting. They are set to Canada (Central), ca-central-1, by default, but you can change them to any Amazon region.

If you chose Canada (Central), skip this step. Otherwise, change both to the region you chose in Choose a Region:

  1. On the External Credentials tab of Named Credentials, open "dryad__Amazon_SES_EC" and click Edit. Set Region to your region code, for example us-east-1, and click Save.
  2. On the Named Credentials tab, open "dryad__Amazon_SES_NC" and click Edit. Set URL to https://email.<your region code>.amazonaws.com, for example https://email.us-east-1.amazonaws.com, and click Save.
Use the same Amazon region everywhere

A different region on the credentials, remote sites or Amazon makes every email fail.

Create the Remote Sites​

Remote sites aren't installed with Dryad Receipting. Salesforce needs two, both for your region: one for sending, and one so it can confirm the Amazon subscription in the last step.

  1. Go to Setup > Security > Remote Site Settings.
  2. Click New Remote Site.
  3. Set Remote Site Name to "DryadMailer".
  4. Set Remote Site URL to https://email.<your region code>.amazonaws.com, for example https://email.ca-central-1.amazonaws.com.
  5. Set Description to "Used for sending emails with Dryad Mailer".
  6. Check Active, and click Save.
  7. Click New Remote Site again, and create "DryadMailerSNS" with the URL https://sns.<your region code>.amazonaws.com, for example https://sns.ca-central-1.amazonaws.com, and the description "Used to confirm the Dryad Mailer subscription".

Create a Salesforce Site​

  1. Go to Setup > User Interface > Sites and Domains > Sites.
  2. Click New.
  3. Set Site Label to "Dryad Mailer".
  4. Set Site Name to "Dryad_Mailer".
  5. Set Site Description to "Used by Dryad Mailer to track email events".
  6. Set Default Web Address to "dryadmailer".
  7. Check Active.
  8. Set Active Site Home Page to "Unauthorized".
  9. Click Save.
  10. Save the site's URL for later, for example <your Salesforce domain>.my.salesforce-sites.com/dryadmailer.

Give the Permission Set to the Guest User​

  1. On the Dryad Mailer site, click Public Access Settings.
  2. Click Assigned Users, and click the "Site Guest User, Dryad Mailer" link.
  3. Under Permission Set Assignments, click Edit Assignments.
  4. Add Email Guest User to Enabled Permission Sets.
  5. Click Save.

Create a Sharing Rule​

Each event Amazon reports is matched to its Email Recipient, so the site's guest user must be able to read Email Recipients.

  1. Go to Setup > Security > Sharing Settings.
  2. Under Sharing Rules, find Email Recipient Sharing Rules, and click New.
  3. Set Label to "Grant Guest User Read Access".
  4. Set Rule Name to "Grant_Guest_User_Read_Access".
  5. Set Description to "Gives the Dryad Mailer site guest user read access to Email Recipients".
  6. Set Rule Type to "Guest user access, based on criteria".
  7. Set the criteria: Field is "Created By ID", Operator is "not equal to", and leave Value blank.
  8. Set Share with to "Dryad Mailer Site Guest User".
  9. Set Access Level to "Read Only".
  10. Click Save.

Confirm the Email Settings​

  1. Go to Receipt Settings > General Settings > Email Settings.
  2. Set Configuration Set to "dryad-mailer-tracking".
  3. Set Named Credential to "dryad__Amazon_SES_NC".
  4. Check that Sender Email Address is an address you verified in Amazon.

Leave Send Emails Using as it is until the last step is done. The Receipt Settings article describes these settings.

Back to Amazon​

Connect SNS to Your Salesforce Site​

  1. From the main menu, select Simple Notification Service.
  2. Go to the "ses-event-notifications" topic.
  3. Select the Subscriptions tab, and click Create subscription.
  4. Set Protocol to "HTTPS".
  5. Set Endpoint to https://<your Salesforce domain>.my.salesforce-sites.com/dryadmailer/services/apexrest/dryad/EmailEventWebhook.
  6. Click Create subscription.
  7. Make sure the status is "Confirmed". If it isn't, select the subscription and click Request confirmation.

Switch On Dryad Mailer​

In Receipt Settings > General Settings > Email Settings, set Send Emails Using to "Amazon SES". From now on, receipts are emailed through Dryad Mailer.

To test it, email one receipt to an address you control, then check that its Email Recipient's Status becomes "Sent" and Delivered gets checked.

Troubleshooting​

SymptomCheck
The SNS subscription stays "Pending confirmation"Check the Endpoint, that the Dryad Mailer site is active, that the guest user has the Email Guest User permission set, and that the remote site for sns.<your region code>.amazonaws.com exists. Then click Request confirmation.
Dryad Mailer recipients are "Failed" with "MessageRejected"The sender address isn't verified in Amazon SES or, in the SES sandbox, the donor's address isn't verified. See Verify Your Sender Address.
Dryad Mailer recipients are "Failed" with a connection errorCheck the access keys on the principal, the Named Credential setting, and that the External Credential's region, the Named Credential's URL and the remote sites all use your region (see Set Your Region).
Dryad Mailer tracking checkboxes never changeCheck the Configuration Set setting, the event destination, the sharing rule on Email Recipient, and that the SNS subscription is "Confirmed".