Send mails to multiple user using Swoosh?

How can I send emails to multiple user using Swoosh. Seen documentation, but only Bamboo support emails to multiple user. I have following code which gives error, how can I send mails to multiple user.

    company_admins = for admin <- company_admins do
      {admin.name, admin.email}
    end

    new_email
    |> to(company_admins)
    |> from({"#{workspace.name}", workspace.support_email})
    |> subject(".........")
    |> render_body("candidate_info.html", %{
      .........
    })
    |> Mailer.deliver()

Your response will be highly appreciable.

can you post the error?

also render_body is from phoenix_swoosh, do you have that installed?

according to the docs your |> to(company_admins) is correct…

Right things were not getting fetched into the variable company_admins. Thanks for response.

1 Like