optional to

This commit is contained in:
Dejan Strbac 2015-12-20 11:28:04 +01:00
parent 6a6bd3c984
commit ae539c8d53

View File

@ -118,8 +118,10 @@ defmodule Mailex.Render do
if email.cc && (length(email.cc) > 0), do:
headers = [ { "Cc", email.cc |> stringify_addresses } | headers ]
if email.to && (length(email.to) > 0), do:
headers = [ { "To", email.to |> stringify_addresses } | headers ]
[ { "From", email.from |> stringify_addresses },
{ "To", email.to |> stringify_addresses },
{ "Subject", email.subject || "" } | headers ]
end