Operational Wastage Management System for Odoo

Amazon SES Plugin for Odoo

The Amazon SES Connector Plugin enables seamless integration between Odoo and Amazon Simple Email Service (SES), allowing all outgoing emails from Odoo to be sent through Amazon SES using the AWS SDK. This integration improves email deliverability, scalability, and overall performance of the email communication system.

The plugin also supports the configuration of Amazon Simple Notification Service (SNS) to receive real-time notifications for email delivery, bounce, and complaint events. These events are automatically captured and stored within Odoo, enabling effective monitoring, tracking, and analysis of email activities.

In addition, the plugin includes a custom unsubscribe mechanism that allows recipients to securely opt out of future communications. A re-subscription option is also provided, enabling partners or recipients to opt back in and resume receiving emails when required. 

 Key Features

  •  Send all Odoo emails via Amazon SES using AWS SDK.

Instead of using Odoo’s traditional SMTP servers, the system routes every outgoing email through Amazon SES using the AWS SDK (SESv2).

  • Configure SNS to receive real-time Delivery, Bounce, and Complain events - Amazon SNS (Simple Notification Service) is configured to receive all events from SES, such as:
    • Delivery → Email reached the recipient’s mail server
    • Bounce → Recipient’s email address is invalid, mailbox full, or blocked
    • Complaint → Recipient marked the email as spam
  • Store SNS notifications in a custom model for email analytics.

A custom Odoo model is created to store all SNS event payloads. And this payload also stores in Odoo mail record.

  • Add Unsubscribe link in every outgoing email using a secure token.

Each outgoing email automatically includes an unsubscribe link containing a secure token. When a recipient clicks the link: -

    • They are taken to a custom Odoo controller
    • The system verifies the token
    • The partner is marked as unsubscribed or added to a blacklist
    • Future emails to the recipient are blocked
  • Resubscribe partners to allow future communication.

A Re-subscribe button is added to the Partner form in Odoo.

When clicked:

  • The partner is removed from the blacklist.
  • They can receive emails again.

Amazon Web Services (AWS) Prerequisites

Before configuring the Amazon SES Plugin in Odoo, the required setup must be completed in the Amazon Web Services (AWS) console. These steps are mandatory to allow Odoo to authenticate with Amazon SES, send emails, and receive delivery, bounce, and complaint notifications. 

 Amazon Web Services (AWS) Prerequisites

1. Log in to the AWS Management Console.

2. Navigate to IAM Users.

3. Create a new IAM user (for example: odoo_ses_user).

This IAM user will be used by Odoo to authenticate with Amazon SES using the AWS SDK 

Figure 1: IAM user summary page

Attach Required IAM Permissions

Attach the following AWS managed policies to the IAM user: 

  • AmazonSESFullAccess
  • AmazonSNSFullAccess

These permissions are required to:

  • Send emails using Amazon SES
  • Publish and receive SNS notifications for Delivery, Bounce, and Complaint events

Without these permissions, email sending and event tracking will not function correctly 

Figure 2: IAM Permissions 

Generate AWS Access Keys

1. Open the IAM user created for Amazon SES.

2. Navigate to Security credentials.

3. Create a new Access Key.

4. Select Application running outside AWS when prompted.

5. Copy and securely store the following credentials:

  1. Access Key ID
  2. Secret Access Key 

Important:

The AWS Secret Access Key is displayed only once during creation. If the secret key is lost, a new access key must be generated, and the old one must be deactivated. 

Figure 3: AWS Access Keys 

 Verify Amazon SES Region

Amazon SES is a region-specific service.

  1. Identify the AWS region where Amazon SES is configured (for example: Europe (Stockholm)).
  2. Ensure the same region is selected later in the Odoo Amazon SES configuration.

A region mismatch between AWS and Odoo will cause connection and email delivery failures. 

Figure 4: AWS Region Selection 

 Verify Sender Email or Domain Identity

  1. Navigate to Amazon SES Configuration Identities.
  2. Verify at least one Email Address or Domain.
  3. Use a verified identity as the Default From Email in Odoo. 

Emails sent from unverified identities will be rejected by Amazon SES. 

Figure 5: AWS Verified Users