PhoenixEmail.Swoosh (PhoenixEmail v0.1.0)

Copy Markdown View Source

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})

Summary

Functions

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

Functions

render_body(email, fun, assigns \\ %{})

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