Krug.Smtp2goSender (Krug v1.1.44) View Source

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

Documentation at https://www.smtp2go.com/setup/

Link to this section Summary

Functions

Send mail over "Smtp2go" 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 "Smtp2go" 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 = %{
     sender_name: "Johannes Backend",
     sender_email: "johannes@has.not.email",
     sender_password: nil,
     replay_to: "johannes_chief@johannesenterpriseserver.com"
   }
iex > Krug.Smtp2goSender.mail(email_configuration,"Lets Party","Party Tommorow at 18:30","any@any.com")
false
iex > email_configuration = %{
     sender_name: "Johannes Backend",
     sender_email: "johannes@has.not.email",
     sender_password: "<johannes_password>",
     replay_to: "johannes_chief@johannesenterpriseserver.com"
   }
iex > Krug.Smtp2goSender.mail(email_configuration,"Lets Party","Party Tommorow at 18:30","any@any.com")
true