mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
refactor {group,inbox}-chatReporter variables
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
BadRequest,
|
||||
NotFound,
|
||||
} from '../errors';
|
||||
import { getGroupUrl, sendTxn } from '../email';
|
||||
import { sendTxn } from '../email';
|
||||
import slack from '../slack';
|
||||
import { model as Group } from '../../models/group';
|
||||
import { chatModel as Chat } from '../../models/message';
|
||||
@@ -50,16 +50,12 @@ export default class GroupChatReporter extends ChatReporter {
|
||||
}
|
||||
|
||||
async notify (group, message, userComment, automatedComment = '') {
|
||||
await super.notify(group, message);
|
||||
|
||||
const groupUrl = getGroupUrl(group);
|
||||
sendTxn(FLAG_REPORT_EMAILS, 'flag-report-to-mods-with-comments', this.emailVariables.concat([
|
||||
{name: 'GROUP_NAME', content: group.name},
|
||||
{name: 'GROUP_TYPE', content: group.type},
|
||||
{name: 'GROUP_ID', content: group._id},
|
||||
{name: 'GROUP_URL', content: groupUrl},
|
||||
let emailVariables = await this.getMessageVariables(group, message);
|
||||
emailVariables = emailVariables.concat([
|
||||
{name: 'REPORTER_COMMENT', content: userComment || ''},
|
||||
]));
|
||||
]);
|
||||
|
||||
sendTxn(FLAG_REPORT_EMAILS, 'flag-report-to-mods-with-comments', emailVariables);
|
||||
|
||||
slack.sendFlagNotification({
|
||||
authorEmail: this.authorEmail,
|
||||
|
||||
Reference in New Issue
Block a user