Krug.AwsSesMailSender (Krug v1.1.44) View Source

A module to simplify use of Bamboo SMTP mailing with the "AWS SES" smtp provider.

Documentation at https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-an-email-using-smtp.html

Link to this section Summary

Functions

Send mail over "AWS SES" smtp provider. Don't uses config.exs file for configuration read. Uses following conventioned configurations

Link to this section Functions

Link to this function

mail(email_configuration, title, body, tto)

View Source

Send mail over "AWS SES" smtp provider. Don't uses config.exs file for configuration read. Uses following conventioned configurations:

[
  adapter: Bamboo.SMTPAdapter,
  chained_adapter: Bamboo.SMTPAdapter,
  server: "",
  port: 587,
  username: "",
  password: "",
  api_key: "my_api_key",
  tls: :always,
  allowed_tls_versions: {:system, "ALLOWED_TLS_VERSIONS"},
  ssl: false,
  retries: 0,
  no_mx_lookups: false,
  auth: :always
]

Received configurations options will be merged in this above. Configurations specific for this smtp provider too.

Return true if call to smtp provider results without errors. However the mail can be not delivered for any reason, by example restrictions quotas.

iex > email_configuration = %{
     server: "email-smtp.us-west-2.amazonaws.com", # https://docs.aws.amazon.com/general/latest/gr/ses.html
     username: "YOUR_SES_USER_NAME", 
     sender_name: "Johannes Backend",
     sender_email: "johannesbackend@has.not.email",
     sender_password: "YOUR_SES_USER_PASSWORD", 
     replay_to: "", # put your reply-to address, or leave blank
  ssl: true # required to be true
   }
iex > Krug.AwsSesMailSender.mail(email_configuration,"Lets Party","Party Tommorow at 18:30","any@any.com")
false
iex > email_configuration = %{
     server: "email-smtp.us-west-2.amazonaws.com", # https://docs.aws.amazon.com/general/latest/gr/ses.html
     username: "YOUR_SES_USER_NAME", 
     sender_name: "Johannes Backend",
     sender_email: "johannesbackend@has.not.email",
     sender_password: "YOUR_SES_USER_PASSWORD", 
     replay_to: "",# put your reply-to address, or leave blank
  ssl: true # required to be true
   }
iex > Krug.AwsSesMailSender.mail(email_configuration,"Lets Party","Party Tommorow at 18:30","any@any.com")
true