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§
- Dynamic
Module - Runtime-composed module unit for conditional imports (feature flags, env switches, plugins).
- InMemory
Mail Transport - Mail
Message - Mail
Module - Mail
Options - Mail
Service - Provider
Registry
Enums§
Traits§
- Injectable
- Application service or provider type constructed through the DI container.
- Mail
Transport
Functions§
- render_
template - Escape and substitute
{{key}}placeholders (Nest built-in engine analogue).