# `PhoenixEmail.Swoosh`
[🔗](https://github.com/gabrielperales/phoenix-email/blob/v0.1.2/lib/phoenix_email/swoosh.ex#L2)

[Swoosh](https://hex.pm/packages/swoosh) integration.

Only compiled when the optional `:swoosh` dependency is present.

    import Swoosh.Email

    new()
    |> to({user.name, user.email})
    |> from({"MyApp", "hello@myapp.com"})
    |> subject("Welcome!")
    |> PhoenixEmail.Swoosh.render_body(&MyApp.Emails.welcome/1, %{name: user.name})

# `render_body`

Renders the function component and sets both the `html_body` and the
`text_body` of the given `Swoosh.Email`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
