使用Resend与SuperStarter

1

创建Resend账户

创建Resend账户并获取您的API密钥。

2

添加环境变量

RESEND_TOKEN环境变量添加到您的.env.local文件和部署环境中:

然后,确保激活Resend:

/packages/email/index.ts
export * from './providers/resend';
3

发送邮件

apps/web/app/contact/actions/contact.tsx
import { resend } from '@repo/email';
import { ContactTemplate } from '@repo/email/emails/contact';

await resend.emails.send({
    from: 'sender@acme.com',
    to: 'recipient@acme.com',
    subject: 'The email subject',
    react: <ContactTemplate name={name} email={email} message={message} />,
});