forked from migadu/mailex
add extra headers
This commit is contained in:
parent
ae539c8d53
commit
f40ecb33f8
@ -1,5 +1,5 @@
|
|||||||
defmodule Mailex.Email do
|
defmodule Mailex.Email do
|
||||||
|
|
||||||
defstruct subject: nil, from: nil, reply_to: nil, to: nil, cc: nil, bcc: nil, attachments: nil, html: nil, text: nil
|
defstruct subject: nil, from: nil, reply_to: nil, to: nil, cc: nil, bcc: nil, headers: nil, attachments: nil, html: nil, text: nil
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -121,6 +121,9 @@ defmodule Mailex.Render do
|
|||||||
if email.to && (length(email.to) > 0), do:
|
if email.to && (length(email.to) > 0), do:
|
||||||
headers = [ { "To", email.to |> stringify_addresses } | headers ]
|
headers = [ { "To", email.to |> stringify_addresses } | headers ]
|
||||||
|
|
||||||
|
if email.headers && (length(email.headers) > 0), do:
|
||||||
|
headers = headers ++ email.headers
|
||||||
|
|
||||||
[ { "From", email.from |> stringify_addresses },
|
[ { "From", email.from |> stringify_addresses },
|
||||||
{ "Subject", email.subject || "" } | headers ]
|
{ "Subject", email.subject || "" } | headers ]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user