LoginSignup
0
0

More than 1 year has passed since last update.

[Rails] AWS SESのSMTPサーバを使う大まかな流れとSandboxを解除したやりとりの記録

Last updated at Posted at 2021-11-25

Deviseのパスワード発行メールのように、返信を気にしないメールをサクッと飛ばしたい時がままあるので記事にしました。

Rails

gem

gem 'aws-sdk-rails'

ActionMailer

# config/initializers/aws.rb

Aws::Rails.add_action_mailer_delivery_method(
    :ses,
    credentials: Aws::Credentials.new(ENV.fetch('AWS_ACCESS_KEY_ID') { 'AWS_ACCESS_KEY_ID' },
                                      ENV.fetch('AWS_SECRET_ACCESS_KEY') { 'AWS_SECRET_ACCESS_KEY' }),
    region: 'ap-northeast-1'
)
# config/environments/production.rb

config.action_mailer.delivery_method = :ses

AWS

IAM

ユーザグループにSESのPermission policy を追加する
IAM > User groups

SES

  1. ドメインの所有者確認とDKIM認証してもらう

    Amazon Simple Email Service

  2. Sandboxの解除リクエスト

  3. その後
    リクエストの詳細確認の連絡が届いたので、回答したところ無事解除されました🎉(というか日本語でもよかったかも)

Good day, thank you to confirm our request. We respond to enhance information. I wonder if you could look at that. Thanks.

how often you send email:
Less than 5 email a month.

how you maintain your recipient lists:
The administrator can regulate at the web site who will receive mail.

your website or app(please include any necessary links):
Website URL: https://www.example.com

how you manage bounces, complaints, and unsubscribe requests:
Only colleague obtains mail. If the member cannot receive a mail, who can ask the administrator.

It is also helpful to provide examples of the email you plan to send so we can ensure that you are sending high-quality content:

Subject:
Reset password instructions

Body:
Hello <%= @resource.email %>!

Someone has requested a link to change your password. You can do this through the link below.

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

If you didn't request this, please ignore this email.
Your password won't change until you access the link above and create a new one.

Hello,

Thank you for submitting your request to increase your sending limits. We are unable to grant your request at this time because we do not have enough information about your use case.

If you can provide additional information about how you plan to use Amazon SES , we may be able to grant your request. In your response, include as much detail as you can about your email-sending use case and how you intend to use Amazon SES.

For example, tell us more about how often you send email, how you maintain your recipient lists, your website or app(please include any necessary links), and how you manage bounces, complaints, and unsubscribe requests. It is also helpful to provide examples of the email you plan to send so we can ensure that you are sending high-quality content.

You can provide this information by replying to this message. Our team provides an initial response to your request within 24 hours. If we're able to do so, we'll grant your request within this 24-hour period. However, if we need to obtain additional information from you, it might take longer to resolve your request.

Thank you for contacting Amazon Web Services.

We value your feedback. Please share your experience by rating this correspondence using the AWS Support Center link at the end of this correspondence. Each correspondence can also be rated by selecting the stars in top right corner of each correspondence within the AWS Support Center.

参考になりました🙏

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0