|
|
@@ -11,58 +11,67 @@ class GlobalNotification {
|
|
|
/**
|
|
|
* send test notification
|
|
|
* @memberof GlobalNotification
|
|
|
+ * @param {string} toEmail
|
|
|
*/
|
|
|
- sendTesteNotification() {}
|
|
|
+ sendTesteNotification(toEmail) {}
|
|
|
|
|
|
/**
|
|
|
* send notification at page creation
|
|
|
* @memberof GlobalNotification
|
|
|
+ * @param {string} toEmail
|
|
|
+ * @param {obejct} page
|
|
|
*/
|
|
|
- sendPageCreateNotification() {}
|
|
|
+ sendCreateNotification(toEmail, page) {
|
|
|
+ // const option = {
|
|
|
+ // to: toEmail,
|
|
|
+ // subject: `#create - ${page.creator.username} created ${page.path}`,
|
|
|
+ // template: 'notification/createPage.txt',
|
|
|
+ // vars: {}
|
|
|
+ // };
|
|
|
+
|
|
|
+ // return mailer.send(option)
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* send notification at page edit
|
|
|
* @memberof GlobalNotification
|
|
|
+ * @param {string} toEmail
|
|
|
+ * @param {obejct} page
|
|
|
*/
|
|
|
- sendPageEditNotification() {}
|
|
|
+ sendEditNotification(toEmail, page) {}
|
|
|
|
|
|
/**
|
|
|
* send notification at page deletion
|
|
|
* @memberof GlobalNotification
|
|
|
+ * @param {string} toEmail
|
|
|
+ * @param {obejct} page
|
|
|
*/
|
|
|
- sendPageDeleteNotification() {}
|
|
|
+ sendDeleteNotification(toEmail, page) {}
|
|
|
|
|
|
/**
|
|
|
* send notification at page move
|
|
|
* @memberof GlobalNotification
|
|
|
+ * @param {string} toEmail
|
|
|
+ * @param {obejct} page
|
|
|
*/
|
|
|
- sendPageMoveNotification() {}
|
|
|
+ sendMoveNotification(toEmail, page) {}
|
|
|
|
|
|
/**
|
|
|
* send notification at page like
|
|
|
* @memberof GlobalNotification
|
|
|
+ * @param {string} toEmail
|
|
|
+ * @param {obejct} page
|
|
|
*/
|
|
|
- sendPageLikeNotification() {}
|
|
|
+ sendLikeNotification(toEmail, page) {}
|
|
|
|
|
|
/**
|
|
|
* send notification at page comment
|
|
|
* @memberof GlobalNotification
|
|
|
+ * @param {string} toEmail
|
|
|
+ * @param {obejct} page
|
|
|
+ * @param {obejct} comment
|
|
|
*/
|
|
|
- sendCommentNotification() {}
|
|
|
+ sendCommentNotification(toEmail, page, comment) {}
|
|
|
}
|
|
|
|
|
|
module.exports = GlobalNotification;
|
|
|
-
|
|
|
-// res.send
|
|
|
-// const notifications = await findSettingByPathAndEvent(path, 'comment');
|
|
|
-// notifications.forEach(notification => {
|
|
|
-// sendCommentNotification(notification);
|
|
|
-// });
|
|
|
-
|
|
|
-
|
|
|
-// const mailOption = {
|
|
|
-// to: '',
|
|
|
-// from: '',
|
|
|
-// text: '#comment',
|
|
|
-// subject: '',
|
|
|
-// };
|