Skip to main content

Crate nestrs_mail

Crate nestrs_mail 

Source
Expand description

NestJS @nestjs/mail analogue — templated email with HTML-escaped {{placeholders}}, pluggable transports, and an in-memory inbox for tests.

ⓘ
use nestrs_mail::{render_template, MailMessage, MailModule, MailOptions, MailService};
use std::collections::HashMap;

let dm = MailModule::register(MailOptions::default());
let mut data = HashMap::new();
data.insert("name".into(), "<b>Ada</b>".into());
let html = render_template("<p>Hi {{name}}</p>", &data);
mail.send(MailMessage {
    to: "a@b.com".into(),
    subject: "Hi".into(),
    html,
    idempotency_key: None,
}).await.unwrap();

Umbrella feature: nestrs / mail → nestrs::mail.

Structs§

DynamicModule
Runtime-composed module unit for conditional imports (feature flags, env switches, plugins).
InMemoryMailTransport
MailMessage
MailModule
MailOptions
MailService
ProviderRegistry

Enums§

MailError

Traits§

Injectable
Application service or provider type constructed through the DI container.
MailTransport

Functions§

render_template
Escape and substitute {{key}} placeholders (Nest built-in engine analogue).

Type Aliases§

SharedMailTransport