Skip to content

Commit

Permalink
Merge pull request #102 from digitalnatives/ggpasqualino/user-name
Browse files Browse the repository at this point in the history
Change user name and email on coherence mailer
  • Loading branch information
ggpasqualino committed Jun 14, 2017
2 parents 383b612 + 82aa349 commit 650037c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions web/emails/coherence/user_email.ex
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,11 @@ defmodule CoursePlanner.Coherence.UserEmail do
end
end

defp first_name(name) do
case String.split(name, " ") do
[first_name | _] -> first_name
_ -> name
end
end
defp first_name(nil), do: "there"
defp first_name(name), do: name

defp user_email(user) do
{user.name, user.email}
end
defp user_email(%{name: nil, email: email}), do: email
defp user_email(%{name: name, email: email}), do: {name, email}

defp from_email do
log_string = """
Expand Down

0 comments on commit 650037c

Please sign in to comment.