Archived
2

fixed mail in user.ts

This commit is contained in:
VLE2FE 2020-08-06 11:40:29 +02:00
parent 5abad59a0e
commit 18e0809a99
2 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ export default class Mail{
}); });
} }
static send (mailAddress, subject, content, f = () => {}) { // callback, executed empty or with error static send (mailAddress, subject, content, f: (x?) => void = () => {}) { // callback, executed empty or with error
if (process.env.NODE_ENV === 'production') { // only send mails in production if (process.env.NODE_ENV === 'production') { // only send mails in production
axios({ axios({
method: 'post', method: 'post',

View File

@ -5,7 +5,7 @@ import _ from 'lodash';
import UserValidate from './validate/user'; import UserValidate from './validate/user';
import UserModel from '../models/user'; import UserModel from '../models/user';
import mail from '../helpers/mail'; import Mail from '../helpers/mail';
import res400 from './validate/res400'; import res400 from './validate/res400';
import db from '../db'; import db from '../db';
@ -133,7 +133,7 @@ router.post('/user/passreset', (req, res, next) => {
if (err) return next(err); if (err) return next(err);
// send email // send email
mail(data[0].email, 'Your new password for the DeFinMa database', Mail.send(data[0].email, 'Your new password for the DeFinMa database',
'Hi, <br><br> You requested to reset your password.<br>Your new password is:<br><br>' + newPass + '' + 'Hi, <br><br> You requested to reset your password.<br>Your new password is:<br><br>' + newPass + '' +
'<br><br>If you did not request a password reset, talk to the sysadmin quickly!<br><br>Have a nice day.' + '<br><br>If you did not request a password reset, talk to the sysadmin quickly!<br><br>Have a nice day.' +
'<br><br>The DeFinMa team', err => { '<br><br>The DeFinMa team', err => {