-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interceptor before normalizing so we can use the rich user info befor…
…e it gets stripped by the formatter
- Loading branch information
Showing
2 changed files
with
14 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,19 @@ defmodule Bamboo.DenyListInterceptor do | |
|
||
@deny_list ["[email protected]"] | ||
|
||
def call(email) do | ||
if Enum.any?(email.to, &(elem(&1, 1) in @deny_list)) do | ||
def call(%{to: recipients} = email) when is_list(recipients) do | ||
if Enum.any?(recipients, &(&1 in @deny_list)) do | ||
Bamboo.Email.block(email) | ||
else | ||
end | ||
end | ||
|
||
def call(%{to: recipient} = email) when recipient in @deny_list do | ||
Bamboo.Email.block(email) | ||
end | ||
|
||
def call(email) do | ||
end | ||
end |