alepha@docs:~/docs/reference/primitives$
cat $email.md | pretty1 min read
#Import
typescript
1import { $email } from "alepha/email";
#Overview
Declares an email channel for sending mail through the configured provider.
The name identifies the channel in the email:sending / email:sent
hooks. send() takes the full message (to, subject, body, …); which
provider delivers it is a module decision (SMTP, Brevo, Cloudflare, or the
in-memory provider under test).
#Options
| Option | Type | Required | Description |
|---|---|---|---|
name |
string |
No | |
provider |
InstantiableClass<EmailProvider> | "memory" |
No |
#Examples
typescript
1class NotificationService {2 email = $email({ name: "notifications" });3 4 async welcome(to: string) {5 await this.email.send({ to, subject: "Welcome!", body: "<p>Hello</p>" });6 }7}