Skip to content

Commit ff06012

Browse files
committed
Update README for using SES ARNs
1 parent 15f77c3 commit ff06012

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,22 @@ Add this gem to your Rails project's Gemfile:
1616
gem 'aws-sdk-rails'
1717
```
1818

19-
This gem also brings in the `aws-sdk-core`, `aws-sdk-sts`, and `aws-sdk-ses`
20-
gems. If you want to use other services (such as S3), you will still need to add
21-
them to your Gemfile:
19+
This gem also brings in the `aws-sdk-core` and `aws-sdk-ses` gems. If you want
20+
to use other services (such as S3), you will still need to add them to your
21+
Gemfile:
2222

2323
```ruby
2424
gem 'aws-sdk-rails', '~> 3'
2525
gem 'aws-sdk-s3', '~> 1'
2626
```
2727

2828
You will have to ensure that you provide credentials for the SDK to use. See the
29-
latest [AWS SDK for Ruby
30-
Docs](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/index.html#Configuration)
29+
latest [AWS SDK for Ruby Docs](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/index.html#Configuration)
3130
for details.
3231

33-
If you're running your Rails application on Amazon EC2, keep in mind that the
34-
AWS SDK will automatically check Amazon EC2 instance metadata for credentials.
35-
Learn more: [IAM Roles for Amazon
36-
EC2](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)
32+
If you're running your Rails application on Amazon EC2, the AWS SDK will
33+
automatically check Amazon EC2 instance metadata for credentials. Learn more:
34+
[IAM Roles for Amazon EC2](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)
3735

3836
# Features
3937

@@ -99,3 +97,25 @@ Aws::Rails.add_action_mailer_delivery_method(
9997
region: 'us-east-1'
10098
)
10199
```
100+
101+
## Using ARNs with SES
102+
103+
This gem uses [`Aws::SES::Client#send_raw_email`](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SES/Client.html#send_raw_email-instance_method)
104+
to send emails. This operation allows you to specify a cross-account identity
105+
for the email's Source, From, and Return-Path. To set these ARNs, use any of the
106+
following headers on your `Mail::Message` object returned by your Mailer class:
107+
108+
* X-SES-SOURCE-ARN
109+
110+
* X-SES-FROM-ARN
111+
112+
* X-SES-RETURN-PATH-ARN
113+
114+
Example:
115+
116+
```
117+
# in your Rails controller
118+
message = MyMailer.send_email(options)
119+
message['X-SES-FROM-ARN'] = 'arn:aws:ses:us-west-2:012345678910:identity/[email protected]'
120+
message.deliver
121+
```

0 commit comments

Comments
 (0)