-
-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Hi @harlan-zw,
While attempting to send emails, I encountered the following error:
422 - An error occurred
While your account is pending approval, all recipient addresses must share the same domain as the 'From' address. The domain of the 'From' address is 'harlanzw.com', but you are attempting to send email to the following domain(s): 'tonightpass.com'.
To resolve this and improve flexibility, we should replace the hardcoded From and Bcc email addresses in the sendWelcomeEmail function with configurable environment variables (NUXT_POSTMARK_FROM and NUXT_POSTMARK_BCC).
Current Function:
export function sendWelcomeEmail(event: H3Event, email: string) {
const client = new ServerClient(useRuntimeConfig(event).postmark.apiKey)
return client.sendEmail({
From: 'harlan@harlanzw.com',
Bcc: 'harlan@harlanzw.com',
To: email,
Subject: 'Welcome to Request Indexing',
TextBody: WelcomeEmail,
})
}Proposed Changes:
Replace 'harlan@harlanzw.com' in the From and Bcc fields with environment variables NUXT_POSTMARK_FROM and NUXT_POSTMARK_BCC, respectively.
Tasks:
- Update the
sendWelcomeEmailfunction to retrieveFromandBccaddresses from environment variables. - Add
NUXT_POSTMARK_FROMandNUXT_POSTMARK_BCCto.env.example.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels