aws / aws/aws-actionmailer-ses-ruby

Add support for configuration_set_name parameter in SES v2

Open
#11 10 comments 4 reactions 1 assignee Claimed by @jterapin View on GitHub
closing-soon feature-request
Dominant language
Ruby
Stars
19
Forks
8
Avg merge
18h 56m
Merged PRs (30d)
1

Description

## Feature Request

### Summary
The `aws-actionmailer-ses` gem's SES v2 implementation does not support passing `configuration_set_name` to the AWS SES v2 API, which is needed for event tracking, reputation monitoring, and delivery customization.

### Current Behavior
The gem only passes `content`, `from_email_address`, and `destination` parameters to `Aws::SESV2::Client#send_email`:

```ruby
# lib/aws/action_mailer/ses_v2/mailer.rb
def deliver!(message)
params = { content: { raw: { data: message.to_s } } }
params[:from_email_address] = from_email_address(message)
params[:destination] = {
to_addresses: to_addresses(message),
cc_addresses: message.cc,
bcc_addresses: message.bcc
}

@client.send_email(params)
end
```

### Expected Behavior
The gem should support passing `configuration_set_name` to enable event tracking, similar to how it supports custom ARN headers.

### Proposed Solution

**Option 1: Global setting in ses_v2_settings**
```ruby
config.action_mailer.ses_v2_settings = {
region: 'us-east-1',
configuration_set_name: 'my-config-set'
}
```

**Option 2: Per-mailer header** (though this may not work with SES v2 API)
```ruby
class MyMailer < ApplicationMailer
default headers: { 'X-SES-CONFIGURATION-SET' => 'my-config-set' }
end
```

**Option 3: Both**
Support both global and per-message configuration sets, with per-message overriding global.

### Workaround
Currently, the only workaround is to set a default configuration set on the verified identity in the AWS SES Console, which applies to ALL emails from that domain.

### AWS SDK Reference
The [AWS SDK for Ruby SESv2 Client](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SESV2/Client.html#send_email-instance_method) supports `configuration_set_name` as a parameter:

```ruby
client.send_email({
configuration_set_name: "ConfigurationSetName",
# ... other params
})
```

### Use Case
Configuration sets are essential for:
- Event tracking (bounces, complaints, deliveries, opens, clicks)
- Reputation monitoring
- Dedicated IP pool management
- Custom MAIL FROM domains
- Different tracking settings per email type (transactional vs marketing)

### Impact
Without this feature, users cannot:
- Track email events per mailer/email type
- Use different IP pools for different email types
- Have granular control over email delivery settings

Would appreciate support for this feature! Happy to contribute a PR if there's interest.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.