forked from beam-community/bamboo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-beam-community#502
- Loading branch information
Showing
6 changed files
with
115 additions
and
17 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
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 |
---|---|---|
|
@@ -335,6 +335,38 @@ defmodule Bamboo.SendGridAdapterTest do | |
assert params["tracking_settings"]["ganalytics"]["utm_content"] == "content" | ||
end | ||
|
||
test "deliver/2 correctly handles when with_click_tracking is enabled" do | ||
email = | ||
new_email( | ||
from: {"From", "[email protected]"}, | ||
subject: "My Subject" | ||
) | ||
|
||
|> Bamboo.SendGridHelper.with_click_tracking(true) | ||
|> SendGridAdapter.deliver(@config) | ||
|
||
assert_receive {:fake_sendgrid, %{params: params}} | ||
assert params["tracking_settings"]["click_tracking"]["enable"] == true | ||
assert params["tracking_settings"]["click_tracking"]["enable_text"] == true | ||
end | ||
|
||
test "deliver/2 correctly handles when with_click_tracking is disabled" do | ||
email = | ||
new_email( | ||
from: {"From", "[email protected]"}, | ||
subject: "My Subject" | ||
) | ||
|
||
|> Bamboo.SendGridHelper.with_click_tracking(false) | ||
|> SendGridAdapter.deliver(@config) | ||
|
||
assert_receive {:fake_sendgrid, %{params: params}} | ||
assert params["tracking_settings"]["click_tracking"]["enable"] == false | ||
assert params["tracking_settings"]["click_tracking"]["enable_text"] == false | ||
end | ||
|
||
test "deliver/2 correctly handles a sendgrid_send_at timestamp" do | ||
email = | ||
new_email( | ||
|
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