8 releases (5 breaking)

new 0.6.0 Jun 16, 2024
0.5.2 Jun 10, 2024
0.4.0 Apr 30, 2024
0.3.0 Feb 6, 2024
0.1.0 Jul 10, 2023

#91 in Email

Download history 128/week @ 2024-02-26 61/week @ 2024-03-04 12/week @ 2024-03-11 58/week @ 2024-04-01 18/week @ 2024-04-15 192/week @ 2024-04-29 28/week @ 2024-05-06 7/week @ 2024-05-13 13/week @ 2024-05-20 33/week @ 2024-05-27 308/week @ 2024-06-03 380/week @ 2024-06-10

735 downloads per month
Used in rss2email

MIT license

71KB
1.5K SLoC

resend-rs

Build Status Crate Docs Crate Version

A minimal Resend client.

Add with:

cargo add resend-rs
cargo add tokio -F macros,rt-multi-thread

Emails are sent via the Resend client which provides both a synchronous and asynchronous send method. The two are mutually exclusive and accessible via the blocking feature. The crate uses reqwest and serde internally.

Documentation

Crate documentation is available in docsrs. Example usage is available in the get started guide on the Resend website, you can also find examples in the API reference.

Features

  • blocking to enable the blocking client.
  • native-tls to use system-native TLS. Enabled by default.
  • rustls-tls to use TLS backed by rustls.

Variables

  • RESEND_API_KEY to enable impl Default for a Resend client (Required).
  • RESEND_BASE_URL to override the default base address: https://api.resend.com (Optional).
  • RESEND_RATE_LIMIT to set the maximum amount of requests you can send per second. By default, this is 9 (Resend defaults to 10). In reality, the time window is set to 1.1s to avoid failures. This is thread-safe (as long as you use the same Resend client across threads!)
WARNING: Rate limiting only works when using the async version (default) of the crate

Dependencies

~6–19MB
~278K SLoC