defmodule PlausibleWeb.EmailView do use PlausibleWeb, :view def plausible_url do PlausibleWeb.Endpoint.url() end def base_domain() do PlausibleWeb.Endpoint.host() end def greet_recipient(%{user: %{name: name}}) when is_binary(name) do "Hey #{String.split(name) |> List.first()}," end def greet_recipient(_), do: "Hey," def date_format(date) do Timex.format!(date, "{D} {Mshort} {YYYY}") end end