赛派号

什么样的燕麦片减肥效果好些 Overview

View Source Resend

Run in Livebook

API client for Resend, the new email API for developers.

API Resend.EmailsResend.DomainsResend.ApiKeys Installation

Install by adding resend to your list of dependencies in mix.exs:

def deps do [ {:resend, "~> 0.4.5"} ] end Getting Started

Send your first email in two steps:

# Configure your Resend API key config :resend, Resend.Client, api_key: "re_123456789"# Send an email Resend.Emails.send(%{ to: "me@example.com", from: "myapp@example.com", subject: "Hello!", text: "👋🏻" })

Elixir script example:

# Se this file as `resend.exs`, run it with `elixir resend.exs` Mix.install([ {:resend, "~> 0.4.5"} ]) # Replace with your API key client = Resend.client(api_key: "re_123456789") # Replace `:to` and `:from` with valid emails Resend.Emails.send(client, %{ to: "me@example.com", from: "myapp@example.com", subject: "Hello!", text: "👋🏻" })

View additional documentation at https://hexdocs.pm/resend.

Swoosh Adapter

This library includes a Swoosh adapter to make using Resend with a new Phoenix project as easy as possible. All you he to do is configure your Mailer:

config :my_app, MyApp.Mailer, adapter: Resend.Swoosh.Adapter, api_key: "re_123456789"

View additional documentation at https://hexdocs.pm/resend/Resend.Swoosh.Adapter.html.

Testing

By default, calls to Resend are mocked in tests. To send live emails while running the test suite, set the following environment variables:

RESEND_KEY="re_123456789" \ RECIPIENT_EMAIL="" \ SENDER_EMAIL="" \ SENT_EMAIL_ID="" \ mix test ← Previous Page API Reference

Hex Package Hex Preview (current file) Download ePub version

Built using ExDoc (v0.32.2) for the Elixir programming language

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lsinopec@gmail.com举报,一经查实,本站将立刻删除。

上一篇 没有了

下一篇没有了