0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/connectors/connector-http-email
Gao Sun ab82e83afb
chore: upgrade vitest and happy-dom (#6858)
* chore: upgrade happy-dom and vitest

* chore: upgrade @vitest/coverage-v8
2024-12-08 01:11:15 +08:00
..
src fix(connector): add tooltip of authorization header field (#6621) 2024-09-24 12:04:29 +08:00
logo-dark.svg
logo.svg
package.json chore: upgrade vitest and happy-dom (#6858) 2024-12-08 01:11:15 +08:00
README.md chore: add tips for HTTP email connector (#6753) 2024-12-06 15:36:13 +08:00

HTTP email connector

The official Logto connector for HTTP email.

Get started

The HTTP email connector allows you to send emails via HTTP call. To use the HTTP email connector, you'll need to have your own email service that expose an HTTP API for sending emails. Logto will call this API when it needs to send an email. For example, when a user registers, Logto will call the HTTP API to send a verification email.

Set up HTTP email connector

To use the HTTP email connector, you need to set up an HTTP endpoint that Logto can call, and an optional authorization token for the endpoint.

💡 Tip

Note that to prevent errors in authentication flow, the configured endpoint must return a 2xx response after receiving the webhook to inform Logto that it has received the notification to send the email.

Meanwhile, in this scenario, you need to monitor email service to ensure successful email delivery. Alternatively, you can add monitoring to your email sending API to promptly detect email delivery failures.

Payload

The HTTP email connector will send the following payload to the endpoint when it needs to send an email:

{
  "to": "foo@logto.io",
  "type": "SignIn",
  "payload": {
    "code": "123456"
  }
}

You can find all of the types in https://docs.logto.io/docs/recipes/configure-connectors/email-connector/configure-popular-email-service/#email-template, and the full type definition of SendMessageData in connector-kit.