fix: #9800, don't send all welcome test emails to test@example.org @julianlam

isekai-main
Barış Soner Uşaklı 3 years ago
parent 92d1ee31e4
commit 71ed50b9c1

@ -14,7 +14,6 @@ Email.test = async function (socket, data) {
...(data.payload || {}),
subject: '[[email:test-email.subject]]',
};
let template;
switch (data.template) {
case 'digest':
@ -34,15 +33,11 @@ Email.test = async function (socket, data) {
break;
case 'verify-email':
template = 'verify-email';
// falls through
case 'welcome':
await userEmail.sendValidationEmail(socket.uid, {
force: 1,
email: 'test@example.org',
template: template || 'welcome',
subject: !template ? `[[email:welcome-to, ${meta.config.title || meta.config.browserTitle || 'NodeBB'}]]` : undefined,
template: data.template,
subject: data.template === 'welcome' ? `[[email:welcome-to, ${meta.config.title || meta.config.browserTitle || 'NodeBB'}]]` : undefined,
});
break;

Loading…
Cancel
Save