mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 04:38:55 +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
|
||||
EmailUnsubscription
|
||||
.remove({email: savedUser.auth.local.email})
|
||||
.then(() => sendTxnEmail(savedUser, 'welcome'));
|
||||
.then(() => {
|
||||
if (!existingUser) sendTxnEmail(savedUser, 'welcome');
|
||||
});
|
||||
|
||||
if (!existingUser) {
|
||||
res.analytics.track('register', {
|
||||
|
|
@ -310,7 +312,9 @@ api.loginSocial = {
|
|||
EmailUnsubscription
|
||||
.remove({email: savedUser.auth[network].emails[0].value.toLowerCase()})
|
||||
.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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue