core/server/api/v0.1/mail.js
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);
    });
}
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);
    });
}
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 ) ; } ) ; }
Send mail helper
Send mail helper