Send New Account Email

amerta


amerta / amerta/payload/utilities/emails/sendNewAccountEmail / sendNewAccountEmail

Function: sendNewAccountEmail()

sendNewAccountEmail(customer): Promise<void>

Defined in: amerta/payload/utilities/emails/sendNewAccountEmail.ts:27

Sends welcome emails for a newly created customer account.

This function sends two emails:

  1. An admin notification email to alert site administrators of the new account
  2. A customer welcome email to the new customer with account details

Both emails are generated using templated email services and sent asynchronously. Any errors during email sending are silently caught and ignored to prevent account creation failures due to email delivery issues.

Parameters

| Parameter | Type | Description | | ------ | ------ | ------ | | customer | Customer | The newly created customer object containing user data |

Returns

Promise<void>

Async

Example

const newCustomer: Customer = { id: '123', email: 'user@example.com', ... };
await sendNewAccountEmail(newCustomer);