@@ -16,24 +16,22 @@ Add this gem to your Rails project's Gemfile:
16
16
gem ' aws-sdk-rails'
17
17
```
18
18
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:
22
22
23
23
``` ruby
24
24
gem ' aws-sdk-rails' , ' ~> 3'
25
25
gem ' aws-sdk-s3' , ' ~> 1'
26
26
```
27
27
28
28
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 )
31
30
for details.
32
31
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 )
37
35
38
36
# Features
39
37
@@ -99,3 +97,25 @@ Aws::Rails.add_action_mailer_delivery_method(
99
97
region: ' us-east-1'
100
98
)
101
99
```
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