Customize Account Templates to Send Transactional Emails

Learn how to send emails using the `Accounts` package template.

Sending a verification email

The Accounts package can be used to send verification emails when a user registers a new account. It can also be used to change account passwords and reset an account if the user forgets the password.

Open the imports/startup/server/accounts folder, and notice the three files inside the folder. These are new files added to the online bookshop project we’ve been building. The file names are email-setup.js, email-templates.js, and index.js.

The index.js file imports the other two files (a Node.js convention). The accounts folder is imported into the index.js file located on the server.

Because the accounts folder is located inside a startup folder, all code inside the folder is imported and executed when the server starts up.

Get hands-on with 1200+ tech skills courses.