-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate feedback mailer from Mailgun to Amazon SES
We are about to start getting charged for Mailgun, whereas at the volumes we use, SES should be free.
- Loading branch information
1 parent
b74ad73
commit acc930d
Showing
10 changed files
with
106 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
use Mix.Config | ||
|
||
config :feedback, | ||
time_fetcher: Feedback.FakeDateTime | ||
time_fetcher: Feedback.FakeDateTime, | ||
exaws_perform_fn: &Feedback.Test.mock_perform/2 |
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
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ defmodule Feedback.MailerTest do | |
nil | ||
) | ||
|
||
assert Test.latest_message()["to"] == "[email protected]" | ||
assert Test.latest_message()["to"] == ["[email protected]"] | ||
end | ||
|
||
test "has the body format that heat 2 expects" do | ||
|
@@ -54,7 +54,10 @@ defmodule Feedback.MailerTest do | |
end | ||
|
||
test "uses the comments of the message for the description" do | ||
Mailer.send_heat_ticket(%{@base_message | comments: "major issue to report"}, nil) | ||
Mailer.send_heat_ticket( | ||
%{@base_message | comments: "major issue to report"}, | ||
nil | ||
) | ||
|
||
assert Test.latest_message()["text"] =~ | ||
"<DESCRIPTION>major issue to report</DESCRIPTION>" | ||
|
@@ -81,7 +84,11 @@ defmodule Feedback.MailerTest do | |
end | ||
|
||
test "the email does not have leading or trailing spaces" do | ||
Mailer.send_heat_ticket(%{@base_message | email: " [email protected] "}, nil) | ||
Mailer.send_heat_ticket( | ||
%{@base_message | email: " [email protected] "}, | ||
nil | ||
) | ||
|
||
assert Test.latest_message()["text"] =~ "<EMAILID>[email protected]</EMAILID>" | ||
end | ||
|
||
|
@@ -111,14 +118,17 @@ defmodule Feedback.MailerTest do | |
end | ||
|
||
test "can attach a photo" do | ||
Mailer.send_heat_ticket(@base_message, [ | ||
%{path: "/tmp/nonsense.txt", filename: "test.png"} | ||
]) | ||
Mailer.send_heat_ticket( | ||
@base_message, | ||
[ | ||
{"test.png", "png data goes here"} | ||
] | ||
) | ||
|
||
assert Test.latest_message()["attachments"] == [ | ||
%{ | ||
"path" => "/tmp/nonsense.txt", | ||
"filename" => "test.png" | ||
"filename" => "test.png", | ||
"data" => "png data goes here" | ||
} | ||
] | ||
end | ||
|
This file was deleted.
Oops, something went wrong.
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