   defp email_item({name, email}), do: %{email: email, name: name}
   defp email_item(email), do: %{email: email}
 
-  defp prepare_from(body, %{from: from}), do: Map.put(body, :from, from |> email_item)
+  defp prepare_from(body, %{from: from}),
+    do: Map.put(body, :from, from |> email_item)
 
   defp prepare_personalizations(body, email) do
     personalizations =


  defp prepare_asm(body, _email), do: body

  defp prepare_custom_headers(body, %{headers: headers}) when map_size(headers) == 0, do: body

  defp prepare_custom_headers(body, %{headers: headers}) do
    Map.put(body, :headers, headers)
  end

  defp prepare_mail_settings(body, %{provider_options: %{mail_settings: mail_settings}}) do
    Map.put(body, :mail_settings, mail_settings)
  end


    Map.put(personalizations, :dynamic_template_data, dynamic_template_data)
  end

  defp prepare_dynamic_template_data(personalizations, _email),
    do: personalizations

  defp prepare_subject(body, %{subject: subject}),
    do: Map.put(body, :subject, subject)

  defp prepare_content(body, %{html_body: html, text_body: text}) do
    content =
      Enum.reject(
        [%{type: "text/plain", value: text}, %{type: "text/html", value: html}],
        &is_nil(&1.value)
      )

    case content do
      [] -> body
      _ -> Map.put(body, :content, content)
    end
  end

  defp prepare_attachments(body, %{attachments: []}), do: body
