@antelopejs/interface-email
AntelopeJS发送电子邮件的合同:一个API,用于单发,批发和模板消息,任何供应商都会发送.
它提供的东西
Send发送一个带有文本或 HTML、收件人、线程头和附件的信息.SendBatch在一个呼叫中发送多条消息, 并共享默认值 .SendTemplate使提供者模板或带有变量的内置模板.GetCapabilities报告提供者支持的内容,例如时间安排或跟踪.Send财务报告和审定财务报表SendTemplate返回状态、可选提供者消息ID和可选错误细节.SendBatch返回总计和每个消息一个结果.GetCapabilities返回提供者的特性和限制,而不是执行结果.
执行情况
| 模块 | 页:1 |
|---|---|
@antelopejs/nodemailer | SMTP 通过节点 |
@antelopejs/brevo | 布莱沃 HTTP API |
安装
向发送电子邮件的模块添加接口 :
pnpm add @antelopejs/interface-email
然后在项目中添加一个执行:
ajs project modules add @antelopejs/nodemailer
快开始
import { Send } from "@antelopejs/interface-email";
export async function sendWelcome(address: string) {
const response = await Send({
to: address,
subject: "Welcome aboard",
html: "<p>Thanks for joining.</p>",
text: "Thanks for joining.",
});
if (!response.success) {
throw new Error(response.error?.message);
}
return response.messageId;
}
文档
兼容性
| 软件包 | 支助 | 测试过 |
|---|---|---|
@antelopejs/interface-core | >=0.2.4 <1.0.0 | 0.2.4 |
表格重复对等区域 package.json。软件包宣布不
@antelopejs/core 对等范围,请检查执行模块的要求.
捐款
读取 捐款额 在你打开拉动请求之前。 当地检查为:
pnpm install
pnpm lint
pnpm build