Send emails with Elixir
Prerequisites
Section titled “Prerequisites”Before you start, you'll need:
- A Resend API key
- A verified domain
Install
Install by adding
resendto your list of dependencies inmix.exs:mix.exs def deps do [ {:resend, "~> 0.4.0"} ] endSend email using HTML
The easiest way to send an email is by using the
htmlparameter.send.exs client = Resend.client(api_key: System.get_env("RESEND_API_KEY")) Resend.Emails.send(client, %{ from: "Acme <onboarding@resend.dev>", to: ["delivered@resend.dev"], subject: "hello world", html: "<strong>it works!</strong>" })
Examples
Section titled “Examples”Basic Send
Basic email sending
Attachments
Send emails with file attachments
Templates
Send emails using Resend hosted templates
Scheduling
Schedule emails for future delivery
Audiences
Manage contacts and audiences
Domains
Create and manage sending domains
Inbound Webhooks
Receive and process inbound emails
Double Opt-in
Double opt-in subscription flow
Phoenix App
Full Phoenix web framework application