|
|
@@ -10,7 +10,7 @@ const testNotifyData = [
|
|
|
"triggerEvents": ["comment, pageCreate"],
|
|
|
"__t": "mail",
|
|
|
"triggerPath": "/*",
|
|
|
- "toEmail": "email@email.com",
|
|
|
+ "toEmail": "takky.yunama71@gmail.com",
|
|
|
"__v": 0
|
|
|
},
|
|
|
{
|
|
|
@@ -67,12 +67,13 @@ class GlobalNotification {
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
notifyPageCreate(page) {
|
|
|
- const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageCreate');
|
|
|
+ // const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageCreate');
|
|
|
+ const notifications = testNotifyData;
|
|
|
const lang = 'en-US'; //FIXME
|
|
|
const option = {
|
|
|
mail: {
|
|
|
subject: `#pageCreate - ${page.creator.username} created ${page.path}`,
|
|
|
- template: path.join(this.crowi.localeDir, lang, 'notifications/pageCreate.txt'),
|
|
|
+ template: `../../locales/${lang}/notifications/pageCreate.txt`,
|
|
|
vars: {}
|
|
|
},
|
|
|
slack: {},
|
|
|
@@ -108,12 +109,13 @@ class GlobalNotification {
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
notifyPageDelete(page) {
|
|
|
- const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageDelete');
|
|
|
+ // const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageDelete');
|
|
|
+ const notifications = testNotifyData;
|
|
|
const lang = 'en-US'; //FIXME
|
|
|
const option = {
|
|
|
mail: {
|
|
|
subject: `#pageDelete - ${page.creator.username} deleted ${page.path}`, //FIXME
|
|
|
- template: path.join(this.crowi.localeDir, lang, 'notifications/pageDelete.txt'),
|
|
|
+ template: `../../locales/${lang}/notifications/pageDelete.txt`,
|
|
|
vars: {}
|
|
|
},
|
|
|
slack: {},
|
|
|
@@ -127,13 +129,14 @@ class GlobalNotification {
|
|
|
* @memberof GlobalNotification
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
- notifyPageMove(page) {
|
|
|
- const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageMove');
|
|
|
+ notifyPageMove(page, user) {
|
|
|
+ // const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageMove');
|
|
|
+ const notifications = testNotifyData;
|
|
|
const lang = 'en-US'; //FIXME
|
|
|
const option = {
|
|
|
mail: {
|
|
|
- subject: `#pageMove - ${page.creator.username} moved ${page.path} to ${page.path}`, //FIXME
|
|
|
- template: path.join(this.crowi.localeDir, lang, 'notifications/pageMove.txt'),
|
|
|
+ subject: `#pageMove - ${user.username} moved ${page.path} to ${page.path}`, //FIXME
|
|
|
+ template: `../../locales/${lang}/notifications/pageMove.txt`,
|
|
|
vars: {}
|
|
|
},
|
|
|
slack: {},
|
|
|
@@ -147,13 +150,14 @@ class GlobalNotification {
|
|
|
* @memberof GlobalNotification
|
|
|
* @param {obejct} page
|
|
|
*/
|
|
|
- notifyPageLike(page) {
|
|
|
- const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageLike');
|
|
|
+ notifyPageLike(page, user) {
|
|
|
+ // const notifications = Notification.findSettingByPathAndEvent(page.path, 'pageLike');
|
|
|
+ const notifications = testNotifyData;
|
|
|
const lang = 'en-US'; //FIXME
|
|
|
const option = {
|
|
|
mail: {
|
|
|
- subject: `#pageLike - ${page.creator.username} liked ${page.path}`,
|
|
|
- template: path.join(this.crowi.localeDir, lang, 'notifications/pageLike.txt'),
|
|
|
+ subject: `#pageLike - ${user.username} liked ${page.path}`,
|
|
|
+ template: `../../locales/${lang}/notifications/pageLike.txt`,
|
|
|
vars: {}
|
|
|
},
|
|
|
slack: {},
|
|
|
@@ -169,12 +173,13 @@ class GlobalNotification {
|
|
|
* @param {obejct} comment
|
|
|
*/
|
|
|
notifyComment(comment, path) {
|
|
|
- const notifications = Notification.findSettingByPathAndEvent(path, 'comment');
|
|
|
+ // const notifications = Notification.findSettingByPathAndEvent(path, 'comment');
|
|
|
+ const notifications = testNotifyData;
|
|
|
const lang = 'en-US'; //FIXME
|
|
|
const option = {
|
|
|
mail: {
|
|
|
subject: `#comment - ${comment.creator.username} commented on ${path}`,
|
|
|
- template: path.join(this.crowi.localeDir, lang, 'notifications/comment.txt'),
|
|
|
+ template: `../../locales/${lang}/notifications/comment.txt`,
|
|
|
vars: {}
|
|
|
},
|
|
|
slack: {},
|