mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
send email when admin unflags post (#7580)
* send email when admin unflags post * Improved email acquisition code, minor changes to sent email * Refactor getGoupUrl into its own method * added unit test for getGroupUrl * improved test and getGroupUrl
This commit is contained in:
committed by
Blade Barringer
parent
00491670e0
commit
8490b481f6
@@ -1,5 +1,6 @@
|
||||
import { createTransport } from 'nodemailer';
|
||||
import nconf from 'nconf';
|
||||
import { TAVERN_ID } from '../../models/group';
|
||||
import { encrypt } from './encryption';
|
||||
import request from 'request';
|
||||
import logger from './logger';
|
||||
@@ -64,6 +65,19 @@ export function getUserInfo (user, fields = []) {
|
||||
return info;
|
||||
}
|
||||
|
||||
export function getGroupUrl (group) {
|
||||
let groupUrl;
|
||||
if (group._id === TAVERN_ID) {
|
||||
groupUrl = '/#/options/groups/tavern';
|
||||
} else if (group.type === 'guild') {
|
||||
groupUrl = `/#/options/groups/guilds/${group._id}`;
|
||||
} else if (group.type === 'party') {
|
||||
groupUrl = 'party';
|
||||
}
|
||||
|
||||
return groupUrl;
|
||||
}
|
||||
|
||||
// Send a transactional email using Mandrill through the external email server
|
||||
export function sendTxn (mailingInfoArray, emailType, variables, personalVariables) {
|
||||
mailingInfoArray = Array.isArray(mailingInfoArray) ? mailingInfoArray : [mailingInfoArray];
|
||||
|
||||
Reference in New Issue
Block a user