mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
chore(email): split test for welcome message
This commit is contained in:
@@ -183,7 +183,12 @@ async function registerLocal (req, res, { isV3 = false }) {
|
|||||||
EmailUnsubscription
|
EmailUnsubscription
|
||||||
.remove({email: savedUser.auth.local.email})
|
.remove({email: savedUser.auth.local.email})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (!existingUser) sendTxnEmail(savedUser, 'welcome');
|
if (existingUser) return;
|
||||||
|
if (savedUser._ABtests && savedUser._ABtests.emailSplit && savedUser._ABtests.emailSplit === '20190222_welcome-v2') {
|
||||||
|
sendTxnEmail(savedUser, 'welcome-v2');
|
||||||
|
} else {
|
||||||
|
sendTxnEmail(savedUser, 'welcome');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!existingUser) {
|
if (!existingUser) {
|
||||||
|
|||||||
@@ -128,6 +128,13 @@ function _setUpNewUser (user) {
|
|||||||
user.purchased.background.violet = true;
|
user.purchased.background.violet = true;
|
||||||
user.preferences.background = 'violet';
|
user.preferences.background = 'violet';
|
||||||
|
|
||||||
|
const testGroup = Math.random();
|
||||||
|
if (testGroup < 0.5) {
|
||||||
|
user._ABtests.emailSplit = '20190222_welcome';
|
||||||
|
} else {
|
||||||
|
user._ABtests.emailSplit = '20190222_welcome-v2';
|
||||||
|
}
|
||||||
|
|
||||||
if (user.registeredThrough === 'habitica-web') {
|
if (user.registeredThrough === 'habitica-web') {
|
||||||
taskTypes = ['habit', 'daily', 'todo', 'reward', 'tag'];
|
taskTypes = ['habit', 'daily', 'todo', 'reward', 'tag'];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user