How to send email with Amazon SES
How to send transactional email notifications to Amazon SES with Knock.
Knock integrates with Amazon Simple Email Service (Amazon SES) to send email notifications to your users. This page walks through how to get started with SES, including provider configurations and additional data you can pass through to SES.
Features
#- Attachments support
- Knock link and open tracking
- Per environment configuration
- Sandbox mode
Getting started
#You can create a new Amazon SES channel in the dashboard under Channels and sources in your account settings. From there, you'll need to take some steps in AWS before you can configure your SES channel within Knock.
Here are a few other things to keep in mind once you have your SES channel configured in Knock:
- SES sandbox mode. By default, AWS places all new accounts in the SES sandbox. While your account is in the sandbox, you can only send emails to verified email address—keep this in mind if you're testing in development before you've moved your account out of the SES sandbox. For more information on the SES sandbox and how to move your account out of it, see the SES sandbox documentation.
- Deliverability tracking. By default, SES channels do not track delivery beyond "Sent". However, you can enable delivery status webhooks to receive real-time updates about email delivery and bounces.
Channel configuration
#The following channel settings should be configured per environment. Navigate to Channels and sources in your dashboard account settings, select your Amazon SES channel, then click "Manage configuration" under the environment that you'd like to configure.
Additional data sent
#Knock sends the following attributes along with your emails (all as Tags):
Sender: always set toknock.appknock_message_id: the ID of the message this email is associated withknock_workflow: the key of the workflow this message was generated fromknock_recipient_id: the Knock ID of the recipient this email is being sent to
You can learn about the role of these SES attributes in the Amazon SES API documentation.
Recipient data requirements
#In order to send an email notification you'll need a valid email property set on your recipient.
Delivery status webhooks
#When enabled, SES will send delivery status updates directly to Knock via webhooks, allowing you to track the full lifecycle of your email messages.
Prerequisites
#Before enabling delivery status webhooks, you need:
- A verified domain or email address in Amazon SES
- An SES channel configured in Knock (see the getting started section above)
- Access to AWS SNS (Simple Notification Service) configuration
Setting up delivery status webhooks
#Supported delivery statuses
#When delivery status webhooks are enabled for SES, Knock will update message statuses based on these SES events:
Complaint events
#When a recipient marks an email as spam, SES publishes a Complaint notification to your SNS topic. Knock records a message.complaint event on the message. A complaint does not change the message's delivery status, because the message was delivered before the recipient reported it.
You can see complaint events in the message timeline in the Knock dashboard, and subscribe to them with outbound webhooks.
Knock handles two special cases in SES Complaint notifications, as follows:
complaintFeedbackTypeisnot-spam: Knock ignores the notification. The receiving mailbox provider retracted an earlier complaint, so Knock does not record an event.complaintSubTypeisOnAccountSuppressionListorOnTenantSuppressionList: Knock records a bounce. SES did not attempt delivery because the address is on a suppression list, so Knock updates the message tobouncedinstead of recording a complaint.
Troubleshooting
#If delivery status updates aren't appearing in Knock:
- Check SNS subscription status. Verify the subscription is "Confirmed" in the AWS SNS console.
- Verify SNS topic configuration. Ensure the SNS topic is correctly configured for Bounce, Complaint, and Delivery notifications.
- Check SES notification settings. Confirm your verified identity is publishing to the correct SNS topic.
- Test with verified addresses. If in SES sandbox mode, ensure you're sending to verified addresses.
