Skip to main content

Mail component

Composer version 3

If you have existing project based on Falcon Platform v2.x please contact us for the migration guide to upgrade to the latest version 3.

Out of the box Deity Composer allows emails to be sent easily using our @deity/falcon-mailer package. Under the hood this uses Node Mailer →.


Each mail service is different

Depending on the service you're using your smtp config might vary. Please refer to the nodemailer docs. We pass the config object as is.

To configure our mailer component add it to your server config as a component. This config might vary depending on your setup.


"components": {
"mailer": {
"package": "@deity/falcon-mailer",
"config": {
"transport": {
"service": "[MAILER_SERVICE]",
"auth": {
"user": "[MAILER_USER]",
"send": {
  • MAILER_SERVICE - this is the service you'd like to use. See a list of supported values here →.
  • MAILER_USER - the username for the service above
  • MAILER_PASSWORD - the password for the service above
  • MAILER_FROM_ADDRESS - the from address, e.g Falcon Shop <>


Out of the box we use the mailer packages sendEmail method to handle password reset requests when the integrated shop doesn't offer this functionality out of the box. For now this only includes BigCommerce and commercetools integrations.

Loading the mailer component

You can easily inject the mailer component into your data source package by injecting it into the classes constructor.


import { injectable, inject, optional } from 'inversify';
export class YourCustomDataSource extends FalconRESTDataSource {
@inject('mailer') @optional() protected mailer: any
) {

Using the mailer component

Once injected you can easily use the sendEmail method.