Remove unauthenticated /send email endpoint
This commit is contained in:
@@ -26,7 +26,7 @@ function getResend(): Resend {
|
||||
* @example
|
||||
* await sendMail({
|
||||
* to: 'jane@example.com',
|
||||
* templateId: 'tmpl_abc123', // optional — defaults to RESEND_TEMPLATE_ID
|
||||
* templateId: 'tmpl_abc123', // required — Resend template id or alias
|
||||
* subject: 'Your license key is ready', // optional — defaults to 'Template Email'
|
||||
* data: { // optional — template variables
|
||||
* firstName: 'Jane',
|
||||
@@ -40,7 +40,7 @@ function getResend(): Resend {
|
||||
export async function sendMail(options: {
|
||||
to: string;
|
||||
subject?: string;
|
||||
templateId?: string;
|
||||
templateId: string;
|
||||
data?: Record<string, string | number>;
|
||||
}) {
|
||||
const { to, subject, templateId, data } = options;
|
||||
@@ -50,7 +50,7 @@ export async function sendMail(options: {
|
||||
to: [to],
|
||||
subject: subject ?? 'Template Email',
|
||||
template: {
|
||||
id: templateId ?? env.RESEND_TEMPLATE_ID,
|
||||
id: templateId,
|
||||
variables: data ?? {}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user