code: function sendMail(object) {
      if (!(mailer instanceof mail.GhostMailer)) {
          mailer = new mail.GhostMailer();
      }
  
      return mailer.send(object.mail[0].message).catch((err) => {
          if (mailer.state.usingDirect) {
              notificationsAPI.add(
                  {
                      notifications: [{
                          type: 'warn',
                          message: [
                              common.i18n.t('warnings.index.unableToSendEmail'),
                              common.i18n.t('common.seeLinkForInstructions', {link: 'https://docs.ghost.org/mail/'})
                          ].join(' ')
                      }]
                  },
                  {context: {internal: true}}
              );
          }
  
          return Promise.reject(err);
      });
  }
docs: Send mail helper