-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from fewlinesco/release/v3.1.1
This release brings back Base64 encoding on headers.
- Loading branch information
Showing
7 changed files
with
88 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,70 @@ | ||
[![Hex pm](https://img.shields.io/hexpm/v/bamboo_smtp.svg)](https://hex.pm/packages/bamboo_smtp) | ||
# Bamboo.SMTPAdapter | ||
|
||
[![Build Status](https://github.com/fewlinesco/bamboo_smtp/workflows/Bamboo%20SMTP/badge.svg)](https://github.com/fewlinesco/bamboo_smtp/actions) | ||
[![Inline docs](http://inch-ci.org/github/fewlinesco/bamboo_smtp.svg)](http://inch-ci.org/github/fewlinesco/bamboo_smtp) | ||
[![Module Version](https://img.shields.io/hexpm/v/bamboo_smtp.svg)](https://hex.pm/packages/bamboo_smtp) | ||
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/bamboo_smtp/) | ||
[![Total Download](https://img.shields.io/hexpm/dt/bamboo_smtp.svg)](https://hex.pm/packages/bamboo_smtp) | ||
[![License](https://img.shields.io/hexpm/l/bamboo_smtp.svg)](https://github.com/fewlinesco/bamboo_smtp/blob/master/LICENSE) | ||
[![Last Updated](https://img.shields.io/github/last-commit/fewlinesco/bamboo_smtp.svg)](https://github.com/fewlinesco/bamboo_smtp/commits/master) | ||
|
||
# Bamboo.SMTPAdapter | ||
|
||
An Adapter for the [Bamboo](https://github.com/thoughtbot/bamboo) email app. | ||
An adapter for the [Bamboo](https://github.com/thoughtbot/bamboo) email app. | ||
|
||
## Installation | ||
|
||
The package can be installed as: | ||
|
||
1. Add `bamboo_smtp` to your list of dependencies in `mix.exs`: | ||
|
||
```elixir | ||
def deps do | ||
[{:bamboo_smtp, "~> 3.1.0"}] | ||
end | ||
``` | ||
```elixir | ||
def deps do | ||
[{:bamboo_smtp, "~> 3.1.0"}] | ||
end | ||
``` | ||
|
||
2. Add `bamboo` and `bamboo_smtp` to your list of applications in `mix.exs`: | ||
2. Add `:bamboo` and `:bamboo_smtp` to your list of applications in `mix.exs`: | ||
|
||
```elixir | ||
def application do | ||
[applications: [:bamboo, :bamboo_smtp]] | ||
end | ||
``` | ||
```elixir | ||
def application do | ||
[applications: [:bamboo, :bamboo_smtp]] | ||
end | ||
``` | ||
|
||
3. Setup your SMTP configuration: | ||
|
||
```elixir | ||
# In your config/config.exs file | ||
config :my_app, MyApp.Mailer, | ||
adapter: Bamboo.SMTPAdapter, | ||
server: "smtp.domain", | ||
hostname: "your.domain", | ||
port: 1025, | ||
username: "[email protected]", # or {:system, "SMTP_USERNAME"} | ||
password: "pa55word", # or {:system, "SMTP_PASSWORD"} | ||
tls: :if_available, # can be `:always` or `:never` | ||
allowed_tls_versions: [:"tlsv1", :"tlsv1.1", :"tlsv1.2"], # or {:system, "ALLOWED_TLS_VERSIONS"} w/ comma seprated values (e.g. "tlsv1.1,tlsv1.2") | ||
ssl: false, # can be `true` | ||
retries: 1, | ||
no_mx_lookups: false, # can be `true` | ||
auth: :if_available # can be `:always`. If your smtp relay requires authentication set it to `:always`. | ||
``` | ||
|
||
*Sensitive credentials should not be committed to source control and are best kept in environment variables. | ||
Using `{:system, "ENV_NAME"}` configuration is read from the named environment variable at runtime.* | ||
|
||
The *hostname* option sets the FQDN to the header of your emails, its optional, but if you don't set it, the underlying `gen_smtp` module will use the hostname of your machine, like `localhost`. | ||
```elixir | ||
# In your config/config.exs file | ||
config :my_app, MyApp.Mailer, | ||
adapter: Bamboo.SMTPAdapter, | ||
server: "smtp.domain", | ||
hostname: "your.domain", | ||
port: 1025, | ||
username: "[email protected]", # or {:system, "SMTP_USERNAME"} | ||
password: "pa55word", # or {:system, "SMTP_PASSWORD"} | ||
tls: :if_available, # can be `:always` or `:never` | ||
allowed_tls_versions: [:"tlsv1", :"tlsv1.1", :"tlsv1.2"], # or {:system, "ALLOWED_TLS_VERSIONS"} w/ comma seprated values (e.g. "tlsv1.1,tlsv1.2") | ||
ssl: false, # can be `true` | ||
retries: 1, | ||
no_mx_lookups: false, # can be `true` | ||
auth: :if_available # can be `:always`. If your smtp relay requires authentication set it to `:always`. | ||
``` | ||
|
||
*Sensitive credentials should not be committed to source control and are best kept in environment variables. | ||
Using `{:system, "ENV_NAME"}` configuration is read from the named environment variable at runtime.* | ||
|
||
The *hostname* option sets the FQDN to the header of your emails, its optional, but if you don't set it, the underlying `gen_smtp` module will use the hostname of your machine, like `localhost`. | ||
|
||
4. Follow Bamboo [Getting Started Guide](https://github.com/thoughtbot/bamboo#getting-started) | ||
|
||
5. **Optional** Set `BambooSMTP.TestAdapter` as your test adapter: | ||
|
||
```elixir | ||
# In your config/config.exs file | ||
if Mix.env() == :test do | ||
config :my_app, MyApp.Mailer, adapter: MyApp.SMTPTestAdapter | ||
end | ||
``` | ||
```elixir | ||
# In your config/config.exs file | ||
if Mix.env() == :test do | ||
config :my_app, MyApp.Mailer, adapter: MyApp.SMTPTestAdapter | ||
end | ||
``` | ||
|
||
## Usage | ||
|
||
You can find more information about advanced features in the [Wiki](https://github.com/fewlinesco/bamboo_smtp/wiki). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters