alexgaribay / sendgrid_elixir

Create and send composable emails with Elixir and SendGrid.
MIT License
86 stars 44 forks source link

add_dynamic_template_data/3 has improper specs for nested template data #43

Open chevinbrown opened 3 years ago

chevinbrown commented 3 years ago

Typespecs are too strict for nested template data:

  @spec add_dynamic_template_data(t, String.t(), String.t() || map()) :: t

My usage:

|> Email.add_dynamic_template_data("item_title", item.title)
|> Email.add_dynamic_template_data("list_of_things", [
  %{"id" => item}
])

This should probably be more permissive?

alexandrubagu commented 2 years ago

I've created a PR for this issue https://github.com/alexgaribay/sendgrid_elixir/pull/45

alexandrubagu commented 2 years ago

WDYT ? @alexgaribay