mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-18 03:52:54 +00:00
fix(flags-emails): allow arrays in FLAG_REPORT_EMAIL
This commit is contained in:
parent
065227fa8c
commit
9d22e65e19
1 changed files with 12 additions and 1 deletions
|
|
@ -302,7 +302,18 @@ api.flagChatMessage = function(req, res, next){
|
|||
group.save(function(err,_saved){
|
||||
if(err) return next(err);
|
||||
if (isProd){
|
||||
utils.txnEmail({email: nconf.get('FLAG_REPORT_EMAIL')}, 'flag-report-to-mods', [
|
||||
|
||||
var addressesToSendTo = nconf.get('FLAG_REPORT_EMAIL');
|
||||
|
||||
if(Array.isArray(addressesToSendTo)){
|
||||
addressesToSendTo = addressesToSendTo.map(function(email){
|
||||
return {email: email}
|
||||
});
|
||||
}else{
|
||||
addressesToSendTo = {email: addressesToSendTo}
|
||||
}
|
||||
|
||||
utils.txnEmail(addressesToSendTo, 'flag-report-to-mods', [
|
||||
{name: "MESSAGE_TIME", content: (new Date(message.timestamp)).toString()},
|
||||
{name: "MESSAGE_TEXT", content: message.text},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue