mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-13 17:52:22 +00:00
do not send welcome email if user already exists
This commit is contained in:
parent
bfc7b9d3e8
commit
d67b9e5688
1 changed files with 6 additions and 2 deletions
|
|
@ -163,7 +163,9 @@ api.registerLocal = {
|
||||||
// Clean previous email preferences and send welcome email
|
// Clean previous email preferences and send welcome email
|
||||||
EmailUnsubscription
|
EmailUnsubscription
|
||||||
.remove({email: savedUser.auth.local.email})
|
.remove({email: savedUser.auth.local.email})
|
||||||
.then(() => sendTxnEmail(savedUser, 'welcome'));
|
.then(() => {
|
||||||
|
if (!existingUser) sendTxnEmail(savedUser, 'welcome');
|
||||||
|
});
|
||||||
|
|
||||||
if (!existingUser) {
|
if (!existingUser) {
|
||||||
res.analytics.track('register', {
|
res.analytics.track('register', {
|
||||||
|
|
@ -310,7 +312,9 @@ api.loginSocial = {
|
||||||
EmailUnsubscription
|
EmailUnsubscription
|
||||||
.remove({email: savedUser.auth[network].emails[0].value.toLowerCase()})
|
.remove({email: savedUser.auth[network].emails[0].value.toLowerCase()})
|
||||||
.exec()
|
.exec()
|
||||||
.then(() => sendTxnEmail(savedUser, 'welcome')); // eslint-disable-line max-nested-callbacks
|
.then(() => {
|
||||||
|
if (!existingUser) sendTxnEmail(savedUser, 'welcome');
|
||||||
|
}); // eslint-disable-line max-nested-callbacks
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!existingUser) {
|
if (!existingUser) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue