mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Fixed mail api usage of the notifcations api
closes #10047 Requiring in the api module correctly wraps the notification api and exposes it as a function.
This commit is contained in:
parent
1c21153b85
commit
7fafa1e152
@ -1,7 +1,7 @@
|
|||||||
const Promise = require('bluebird');
|
const Promise = require('bluebird');
|
||||||
const common = require('../../lib/common');
|
const common = require('../../lib/common');
|
||||||
const mailService = require('../../services/mail');
|
const mailService = require('../../services/mail');
|
||||||
const notificationsAPI = require('./notifications');
|
const api = require('./');
|
||||||
let mailer;
|
let mailer;
|
||||||
let _private = {};
|
let _private = {};
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ _private.sendMail = (object) => {
|
|||||||
|
|
||||||
return mailer.send(object.mail[0].message).catch((err) => {
|
return mailer.send(object.mail[0].message).catch((err) => {
|
||||||
if (mailer.state.usingDirect) {
|
if (mailer.state.usingDirect) {
|
||||||
notificationsAPI.add(
|
api.notifications.add(
|
||||||
{
|
{
|
||||||
notifications: [{
|
notifications: [{
|
||||||
type: 'warn',
|
type: 'warn',
|
||||||
|
Loading…
Reference in New Issue
Block a user