Download App prompts & reminders
reminds the newly joined users to download the jamkazam app using modal popup and emails.
This commit is contained in:
parent
71716b2240
commit
598cd26d60
|
|
@ -5,20 +5,28 @@ import FalconCardHeader from '../common/FalconCardHeader';
|
|||
import { useTranslation } from 'react-i18next';
|
||||
import JKProfileAvatar from '../profile/JKProfileAvatar';
|
||||
import { useAuth } from '../../context/UserAuth';
|
||||
import { useForm, Controller } from 'react-hook-form';
|
||||
import { useForm, Controller, set } from 'react-hook-form';
|
||||
import { getInstruments, getGenres, updateUser, getCountries, getRegions, getCities } from '../../helpers/rest';
|
||||
import JKProfileAvatarUpload from '../profile/JKProfileAvatarUpload';
|
||||
import JKDownloadAppReminderModal from '../profile/JKDownloadAppReminderModal';
|
||||
import JKUnsavedDataModal from '../profile/JKUnsavedDataModal';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { Prompt } from 'react-router';
|
||||
// import { Prompt } from 'react-router';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useAppData } from '../../context/AppDataContext';
|
||||
|
||||
function JKEditProfile() {
|
||||
const { t } = useTranslation('profile');
|
||||
const { currentUser } = useAuth();
|
||||
const history = useHistory();
|
||||
|
||||
const [musicInstruments, setMusicInstruments] = useState([]);
|
||||
const [userMusicInstruments, setUserMusicInstruments] = useState([]);
|
||||
const [userMusicInstrumentsReceived, setUserMusicInstrumentsReceived] = useState(false);
|
||||
const [showDownloadAppReminder, setShowDownloadAppReminder] = useState(false);
|
||||
const [showUnsavedDataModal, setShowUnsavedDataModal] = useState(false);
|
||||
const hasDownloadedApp = React.useRef(false);
|
||||
const [nextLocation, setNextLocation] = useState(null);
|
||||
|
||||
const [genres, setGenres] = useState([]);
|
||||
const [userGenres, setUserGenres] = useState([]);
|
||||
|
|
@ -32,6 +40,9 @@ function JKEditProfile() {
|
|||
const [cities, setCities] = useState([]);
|
||||
const [showAvatarUpload, setShowAvatarUpload] = useState(false);
|
||||
const [updating, setUpdating] = useState(false);
|
||||
const [isBlocking, setIsBlocking] = useState(false);
|
||||
|
||||
let unblock = null;
|
||||
|
||||
// const { userProfile, photoUrl } = useUserProfile(currentUser);
|
||||
const { appData } = useAppData();
|
||||
|
|
@ -73,6 +84,11 @@ function JKEditProfile() {
|
|||
setUserGenresReceived(true);
|
||||
setUserMusicInstruments(userProfile.instruments);
|
||||
setUserMusicInstrumentsReceived(true);
|
||||
hasDownloadedApp.current = !!userProfile.first_downloaded_client_at
|
||||
if(!hasDownloadedApp.current){
|
||||
setIsBlocking(true);
|
||||
}
|
||||
|
||||
}, [userProfile]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
|
|
@ -81,6 +97,7 @@ function JKEditProfile() {
|
|||
fetchCountries();
|
||||
}, []);
|
||||
|
||||
|
||||
const updateFormData = data => {
|
||||
setValue('firstName', data.first_name);
|
||||
setValue('lastName', data.last_name);
|
||||
|
|
@ -390,7 +407,19 @@ function JKEditProfile() {
|
|||
|
||||
useEffect(() => {
|
||||
function beforeUnload(e) {
|
||||
if (updating) e.preventDefault();
|
||||
|
||||
if (updating) {
|
||||
e.preventDefault();
|
||||
setShowUnsavedDataModal(true);
|
||||
return false; // prevent navigation
|
||||
}
|
||||
|
||||
if (!hasDownloadedApp.current && (!!localStorage.getItem('downloadAppReminded') === false || localStorage.getItem('downloadAppReminded') !== 'true')) {
|
||||
e.preventDefault();
|
||||
setShowDownloadAppReminder(true);
|
||||
return false; // prevent navigation
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
window.addEventListener('beforeunload', beforeUnload);
|
||||
|
|
@ -400,13 +429,59 @@ function JKEditProfile() {
|
|||
};
|
||||
}, [updating]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (isBlocking) {
|
||||
unblock = history.block((tx) => {
|
||||
console.log('Blocking navigation', tx, updating);
|
||||
setNextLocation(tx);
|
||||
|
||||
if (updating) {
|
||||
setShowUnsavedDataModal(true);
|
||||
return false; // prevent navigation
|
||||
}
|
||||
|
||||
if (!hasDownloadedApp.current && (!!localStorage.getItem('downloadAppReminded') === false || localStorage.getItem('downloadAppReminded') !== 'true')) {
|
||||
setShowDownloadAppReminder(true);
|
||||
return false; // prevent navigation
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
if (unblock) {
|
||||
unblock(); // remove blocker if not blocking anymore
|
||||
}
|
||||
}
|
||||
return () => {
|
||||
if (unblock) unblock();
|
||||
};
|
||||
}, [isBlocking, history, updating]);
|
||||
|
||||
const toggleAvatarUpload = () => {
|
||||
setShowAvatarUpload(!showAvatarUpload);
|
||||
};
|
||||
|
||||
const onLeaveUnsavedData = () => {
|
||||
if(nextLocation && nextLocation.pathname) {
|
||||
history.push(nextLocation.pathname);
|
||||
}else{
|
||||
history.push('/');
|
||||
}
|
||||
setShowUnsavedDataModal(false);
|
||||
}
|
||||
|
||||
const onCancelAppReminder = () => {
|
||||
if(nextLocation && nextLocation.pathname) {
|
||||
history.push(nextLocation.pathname);
|
||||
} else {
|
||||
history.push('/');
|
||||
}
|
||||
setShowDownloadAppReminder(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Prompt when={updating} message="The changes are being saved. Are you sure you want to leave?" />
|
||||
{/* <Prompt when={updating} message="The changes are being saved. Are you sure you want to leave?" /> */}
|
||||
<Card>
|
||||
<FalconCardHeader title={t('page_title', { ns: 'profile' })} titleClass="font-weight-bold">
|
||||
{updating && (
|
||||
|
|
@ -762,6 +837,11 @@ function JKEditProfile() {
|
|||
</CardBody>
|
||||
</Card>
|
||||
<JKProfileAvatarUpload show={showAvatarUpload} toggle={toggleAvatarUpload} />
|
||||
<JKUnsavedDataModal show={showUnsavedDataModal} onLeave={onLeaveUnsavedData} />
|
||||
<JKDownloadAppReminderModal
|
||||
show={showDownloadAppReminder}
|
||||
onCancel={onCancelAppReminder}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
|
||||
const JKDownloadAppReminderModal = ({ show, onCancel }) => {
|
||||
const [modal, setModal] = useState(false);
|
||||
const { t } = useTranslation("profile");
|
||||
const history = useHistory();
|
||||
|
||||
const toggle = () => {
|
||||
setModal(!modal);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if(show){
|
||||
localStorage.setItem('downloadAppReminded', 'true');
|
||||
}
|
||||
setModal(show);
|
||||
}, [show]);
|
||||
|
||||
const onDownloadAppClick = () => {
|
||||
history.push('/public/downloads');
|
||||
setModal(false);
|
||||
}
|
||||
|
||||
const onDownloadLegacyAppClick = () => {
|
||||
history.push('/public/downloads-legacy');
|
||||
setModal(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal isOpen={modal} toggle={toggle} scrollable={true} data-testid="modal-choose-friends">
|
||||
<ModalHeader toggle={toggle}>{t('app_download_reminder.next_step')}</ModalHeader>
|
||||
<ModalBody>
|
||||
<p>
|
||||
{t('app_download_reminder.paragraph1')}
|
||||
</p>
|
||||
<p>
|
||||
{t('app_download_reminder.paragraph2')}
|
||||
<ul>
|
||||
<li>{t('app_download_reminder.paragraph2_list_item1')}</li>
|
||||
<li>{t('app_download_reminder.paragraph2_list_item2')}</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
{t('app_download_reminder.paragraph3')}
|
||||
</p>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="primary" onClick={onDownloadAppClick}>
|
||||
{t('app_download_reminder.download_app')}
|
||||
</Button>{' '}
|
||||
<Button color="primary" onClick={onDownloadLegacyAppClick}>
|
||||
{t('app_download_reminder.download_legacy_app')}
|
||||
</Button>{' '}
|
||||
<Button color="secondary" outline onClick={onCancel}>
|
||||
{t('app_download_reminder.not_now')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
JKDownloadAppReminderModal.propTypes = {
|
||||
show: PropTypes.bool,
|
||||
onCancel: PropTypes.func,
|
||||
};
|
||||
|
||||
export default JKDownloadAppReminderModal
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const JKUnsavedDataModal = ({ show, onLeave }) => {
|
||||
const [modal, setModal] = useState(false);
|
||||
const { t } = useTranslation("profile");
|
||||
|
||||
const toggle = () => {
|
||||
setModal(!modal);
|
||||
}
|
||||
|
||||
const onCancel = () => {
|
||||
setModal(false);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setModal(show);
|
||||
}
|
||||
, [show]);
|
||||
|
||||
return (
|
||||
<Modal isOpen={modal} toggle={toggle} scrollable={true} data-testid="modal-choose-friends">
|
||||
<ModalHeader toggle={toggle}>{t('unsaved_data_warning.title')}</ModalHeader>
|
||||
<ModalBody>
|
||||
<p>
|
||||
{t('unsaved_data_warning.message')}
|
||||
</p>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="primary" onClick={onLeave}>
|
||||
{t('unsaved_data_warning.leave')}
|
||||
</Button>{' '}
|
||||
<Button color="secondary" onClick={onCancel}>
|
||||
{t('unsaved_data_warning.cancel')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
JKUnsavedDataModal.propTypes = {
|
||||
show: PropTypes.bool,
|
||||
onLeave: PropTypes.func,
|
||||
};
|
||||
|
||||
export default JKUnsavedDataModal
|
||||
|
|
@ -26,5 +26,23 @@
|
|||
"delete": "Delete Photo",
|
||||
"cacel": "Cancel",
|
||||
"save": "Save"
|
||||
},
|
||||
"app_download_reminder": {
|
||||
"next_step": "Next Step: Download Jamkazam App",
|
||||
"paragraph1": "The next thing you should do with JamKazam is download and install our free app for Windows or Mac. You’ll need this app to play music online with others, and the app also gives you access to more advanced JamTracks features if you’re interested in using our huge catalog of backing tracks.",
|
||||
"paragraph2": "To go to the app download page, most users should click the Download App button below, with these exceptions:",
|
||||
"paragraph2_list_item1": "If you’re on a Mac that can’t run MacOS 10.15 or later, click the Download Legacy App button, as that version of the app supports older MacOS versions back to 10.7.",
|
||||
"paragraph2_list_item2": "If you’re on Windows 7, click the Download Legacy App button, as that version of the app supports Windows 7 computers.",
|
||||
"download_app": "Download App",
|
||||
"download_legacy_app": "Download Legacy App",
|
||||
"not_now": "Not Now",
|
||||
"paragraph3": "After downloading, double click the downloaded installer, and then follow the on-screen instructions to install the app.",
|
||||
"paragraph4": "For next steps after downloading and installing the app, don’t forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. We’re always happy to help!"
|
||||
},
|
||||
"unsaved_data_warning": {
|
||||
"title": "Unsaved Data",
|
||||
"message": "You have unsaved data. Are you sure you want to leave this page?",
|
||||
"cancel": "Cancel",
|
||||
"leave": "Leave"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
class AddAppDownloadReminderColumnsToUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
execute "ALTER TABLE users ADD COLUMN app_download_reminder1_sent_at TIMESTAMP"
|
||||
execute "ALTER TABLE users ADD COLUMN app_download_reminder2_sent_at TIMESTAMP"
|
||||
execute "ALTER TABLE users ADD COLUMN app_download_reminder3_sent_at TIMESTAMP"
|
||||
end
|
||||
def self.down
|
||||
execute "ALTER TABLE users DROP COLUMN app_download_reminder1_sent_at"
|
||||
execute "ALTER TABLE users DROP COLUMN app_download_reminder2_sent_at"
|
||||
execute "ALTER TABLE users DROP COLUMN app_download_reminder3_sent_at"
|
||||
end
|
||||
end
|
||||
|
|
@ -454,6 +454,39 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
|
||||
def app_download_reminder1(user)
|
||||
@user = user
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
sendgrid_unique_args :type => "app_download_reminder1"
|
||||
mail(:to => user.email, :subject => I18n.t('user_mailer.app_download_reminder1.subject')) do |format|
|
||||
format.text
|
||||
format.html { render layout: "user_mailer_beta" }
|
||||
end
|
||||
end
|
||||
|
||||
def app_download_reminder2(user)
|
||||
@user = user
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
sendgrid_unique_args :type => "app_download_reminder2"
|
||||
mail(:to => user.email, :subject => I18n.t('user_mailer.app_download_reminder2.subject')) do |format|
|
||||
format.text
|
||||
format.html { render layout: "user_mailer_beta" }
|
||||
end
|
||||
end
|
||||
|
||||
def app_download_reminder3(user)
|
||||
@user = user
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
sendgrid_unique_args :type => "app_download_reminder3"
|
||||
mail(:to => user.email, :subject => I18n.t('user_mailer.app_download_reminder3.subject')) do |format|
|
||||
format.text
|
||||
format.html { render layout: "user_mailer_beta" }
|
||||
end
|
||||
end
|
||||
|
||||
#################################### NOTIFICATION EMAILS ####################################
|
||||
def friend_request(user, msg, friend_request_id)
|
||||
return if !user.subscribe_email
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
<p><%=I18n.t('user_mailer.app_download_reminder1.greeting') -%> <%= @user.first_name -%> -</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph1') -%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph2') -%>
|
||||
<ul>
|
||||
<li><%=I18n.t('user_mailer.app_download_reminder1.paragraph2_list_item1') -%></li>
|
||||
<li><%=I18n.t('user_mailer.app_download_reminder1.paragraph2_list_item2') -%></li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p style="text-align:center">
|
||||
<a href="<%= APP_CONFIG.spa_origin_url %>/public/downloads" style="color: #fff;
|
||||
margin-right: 0.5rem;
|
||||
text-decoration: none;
|
||||
background-color: #2c7be5;
|
||||
border-color: #2c7be5;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.3125rem 1rem;
|
||||
line-height: 2.5;
|
||||
font-size: 1em;
|
||||
border-radius: 0.25rem;
|
||||
transition: color 0.15s ease-in-out,
|
||||
background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
|
||||
box-shadow 0.15s ease-in-out;">
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.download_app') -%>
|
||||
</a>
|
||||
|
||||
<a href="<%= APP_CONFIG.spa_origin_url %>/public/downloads-legacy" style="color: #fff;
|
||||
text-decoration: none;
|
||||
background-color: #2c7be5;
|
||||
border-color: #2c7be5;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.3125rem 1rem;
|
||||
line-height: 2.5;
|
||||
font-size: 1em;
|
||||
border-radius: 0.25rem;
|
||||
transition: color 0.15s ease-in-out,
|
||||
background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
|
||||
box-shadow 0.15s ease-in-out;">
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.download_legacy_app') -%>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph3') -%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph4') -%>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.regards') -%>
|
||||
<br />
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.signature') -%>
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<%=I18n.t('user_mailer.app_download_reminder1.greeting') -%> <%= @user.first_name -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph1') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph2') -%>
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph2_list_item1') -%>
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph2_list_item2') -%>
|
||||
|
||||
<%= APP_CONFIG.spa_origin_url %>/public/downloads
|
||||
|
||||
<%= APP_CONFIG.spa_origin_url %>/public/downloads-legacy
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph3') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.paragraph4') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.regards') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder1.signature') -%>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<p><%=I18n.t('user_mailer.app_download_reminder2.greeting') -%> <%= @user.first_name -%> -</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph1') -%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph2') -%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph3') -%>
|
||||
<ul>
|
||||
<li><%=I18n.t('user_mailer.app_download_reminder2.paragraph3_list_item1') -%></li>
|
||||
<li><%=I18n.t('user_mailer.app_download_reminder2.paragraph3_list_item2') -%></li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p style="text-align:center">
|
||||
<a href="<%= APP_CONFIG.spa_origin_url %>/public/downloads" style="color: #fff;
|
||||
margin-right: 0.5rem;
|
||||
text-decoration: none;
|
||||
background-color: #2c7be5;
|
||||
border-color: #2c7be5;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.3125rem 1rem;
|
||||
line-height: 2.5;
|
||||
font-size: 1em;
|
||||
border-radius: 0.25rem;
|
||||
transition: color 0.15s ease-in-out,
|
||||
background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
|
||||
box-shadow 0.15s ease-in-out;">
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.download_app') -%>
|
||||
</a>
|
||||
|
||||
<a href="<%= APP_CONFIG.spa_origin_url %>/public/downloads-legacy" style="color: #fff;
|
||||
text-decoration: none;
|
||||
background-color: #2c7be5;
|
||||
border-color: #2c7be5;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.3125rem 1rem;
|
||||
line-height: 2.5;
|
||||
font-size: 1em;
|
||||
border-radius: 0.25rem;
|
||||
transition: color 0.15s ease-in-out,
|
||||
background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
|
||||
box-shadow 0.15s ease-in-out;">
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.download_legacy_app') -%>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph4') -%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph5') -%>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.regards') -%>
|
||||
<br />
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.signature') -%>
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<%=I18n.t('user_mailer.app_download_reminder2.greeting') -%> <%= @user.first_name -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph1') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph2') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph3') -%>
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph3_list_item1') -%>
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph3_list_item2') -%>
|
||||
|
||||
<%= APP_CONFIG.spa_origin_url %>/public/downloads
|
||||
|
||||
<%= APP_CONFIG.spa_origin_url %>/public/downloads-legacy
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph4') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.paragraph5') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.regards') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder2.signature') -%>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<p><%=I18n.t('user_mailer.app_download_reminder3.greeting') -%> <%= @user.first_name -%> -</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph1') -%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph2') -%>
|
||||
<ul>
|
||||
<li><%=I18n.t('user_mailer.app_download_reminder3.paragraph2_list_item1') -%></li>
|
||||
<li><%=I18n.t('user_mailer.app_download_reminder3.paragraph2_list_item2') -%></li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p style="text-align:center">
|
||||
<a href="<%= APP_CONFIG.spa_origin_url %>/public/downloads" style="color: #fff;
|
||||
margin-right: 0.5rem;
|
||||
text-decoration: none;
|
||||
background-color: #2c7be5;
|
||||
border-color: #2c7be5;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.3125rem 1rem;
|
||||
line-height: 2.5;
|
||||
font-size: 1em;
|
||||
border-radius: 0.25rem;
|
||||
transition: color 0.15s ease-in-out,
|
||||
background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
|
||||
box-shadow 0.15s ease-in-out;">
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.download_app') -%>
|
||||
</a>
|
||||
|
||||
<a href="<%= APP_CONFIG.spa_origin_url %>/public/downloads-legacy" style="color: #fff;
|
||||
text-decoration: none;
|
||||
background-color: #2c7be5;
|
||||
border-color: #2c7be5;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.3125rem 1rem;
|
||||
line-height: 2.5;
|
||||
font-size: 1em;
|
||||
border-radius: 0.25rem;
|
||||
transition: color 0.15s ease-in-out,
|
||||
background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
|
||||
box-shadow 0.15s ease-in-out;">
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.download_legacy_app') -%>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph3') -%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph4') -%>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<p>
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.regards') -%>
|
||||
<br />
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.signature') -%>
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<%=I18n.t('user_mailer.app_download_reminder3.greeting') -%> <%= @user.first_name -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph1') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph2') -%>
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph2_list_item1') -%>
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph2_list_item2') -%>
|
||||
|
||||
<%= APP_CONFIG.spa_origin_url %>/public/downloads
|
||||
<%= APP_CONFIG.spa_origin_url %>/public/downloads-legacy
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph3') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.paragraph4') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.regards') -%>
|
||||
|
||||
<%=I18n.t('user_mailer.app_download_reminder3.signature') -%>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
module JamRuby
|
||||
class AppDownloadReminder
|
||||
|
||||
def self.send_reminders
|
||||
#If the user has not downloaded the app 2 days after signup, then send reminder email 1
|
||||
reminder1_users.each do |user|
|
||||
UserMailer.app_download_reminder1(user).deliver_now
|
||||
user.update(app_download_reminder1_sent_at: Time.now)
|
||||
end
|
||||
|
||||
#If the user has not downloaded the app 4 days after signup, then send reminder email2
|
||||
reminder2_users.each do |user|
|
||||
UserMailer.app_download_reminder2(user).deliver_now
|
||||
user.update(app_download_reminder2_sent_at: Time.now)
|
||||
end
|
||||
|
||||
#If the user has not downloaded the app 6 days after signup, then send reminder email3
|
||||
reminder3_users.each do |user|
|
||||
UserMailer.app_download_reminder3(user).deliver_now
|
||||
user.update(app_download_reminder3_sent_at: Time.now)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def self.prospect_users
|
||||
User.where("users.first_downloaded_client_at IS NULL")
|
||||
end
|
||||
|
||||
def self.reminder1_users
|
||||
AppDownloadReminder.prospect_users.where("users.created_at > ? AND users.app_download_reminder1_sent_at IS NULL", 2.day.ago)
|
||||
end
|
||||
|
||||
def self.reminder2_users
|
||||
AppDownloadReminder.prospect_users.where("users.created_at > ? AND users.app_download_reminder1_sent_at IS NOT NULL AND users.app_download_reminder2_sent_at IS NULL", 4.days.ago)
|
||||
end
|
||||
|
||||
def self.reminder3_users
|
||||
AppDownloadReminder.prospect_users.where("users.created_at > ? AND users.app_download_reminder2_sent_at IS NOT NULL AND users.app_download_reminder3_sent_at IS NULL", 6.days.ago)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
# == Schema Information
|
||||
|
|
@ -14,6 +14,7 @@ module JamRuby
|
|||
User.hourly_check
|
||||
AffiliatePartner.tally_up(Date.today)
|
||||
EmailProfileReminder.send_reminders
|
||||
AppDownloadReminder.send_reminders
|
||||
ConnectionManager.new.cleanup_dangling
|
||||
|
||||
@@log.info("done")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
object @profile
|
||||
|
||||
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :follower_count, :following_count, :recording_count, :session_count, :biography, :favorite_count, :audio_latency, :upcoming_session_count, :age, :website, :skill_level, :concert_count, :studio_session_count, :virtual_band, :virtual_band_commitment, :traditional_band, :traditional_band_commitment, :traditional_band_touring, :paid_sessions, :paid_sessions_hourly_rate,
|
||||
:paid_sessions_daily_rate, :free_sessions, :cowriting, :cowriting_purpose, :subscribe_email, :is_a_teacher, :is_a_student, :last_active_timestamp, :v2_photo_url, :v2_photo_uploaded
|
||||
:paid_sessions_daily_rate, :free_sessions, :cowriting, :cowriting_purpose, :subscribe_email, :is_a_teacher, :is_a_student, :last_active_timestamp, :v2_photo_url, :v2_photo_uploaded, :first_downloaded_client_at
|
||||
|
||||
child :online_presences => :online_presences do
|
||||
attributes :id, :service_type, :username
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ en:
|
|||
paragraph4: "For next steps, don’t forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. We’re always happy to help"
|
||||
regards: "Best Regards,"
|
||||
signature: "JamKazam Team"
|
||||
|
||||
profile_complete_reminder2:
|
||||
subject: "Complete your JamKazam profile"
|
||||
greeting: "Hello"
|
||||
|
|
@ -92,7 +91,6 @@ en:
|
|||
paragraph2: "For next steps after your profile, don’t forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. We’re always happy to help!"
|
||||
regards: "Best Regards,"
|
||||
signature: "JamKazam Team"
|
||||
|
||||
profile_complete_reminder3:
|
||||
subject: "Complete your JamKazam profile"
|
||||
greeting: "Hello"
|
||||
|
|
@ -100,3 +98,45 @@ en:
|
|||
update_profile: "Update Profile"
|
||||
regards: "Best Regards,"
|
||||
signature: "JamKazam Team"
|
||||
app_download_reminder1:
|
||||
subject: "Download the free JamKazam app now – it’s your next step"
|
||||
next_step: "Next Step: Download Jamkazam App"
|
||||
greeting: "Hello"
|
||||
paragraph1: "The next thing you should do with JamKazam is download and install our free app for Windows or Mac. You’ll need this app to play music online with others, and the app also gives you access to more advanced JamTracks features if you’re interested in using our huge catalog of backing tracks."
|
||||
paragraph2: "To go to the app download page, most users should click the Download App button below, with these exceptions:"
|
||||
paragraph2_list_item1: "If you’re on a Mac that can’t run MacOS 10.15 or later, click the Download Legacy App button, as that version of the app supports older MacOS versions back to 10.7."
|
||||
paragraph2_list_item2: "If you’re on Windows 7, click the Download Legacy App button, as that version of the app supports Windows 7 computers."
|
||||
download_app: "Download App"
|
||||
download_legacy_app: "Download Legacy App"
|
||||
not_now: "Not Now"
|
||||
paragraph3: "After downloading, double click the downloaded installer, and then follow the on-screen instructions to install the app."
|
||||
paragraph4: "For next steps after downloading and installing the app, don’t forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. We’re always happy to help!"
|
||||
regards: "Best Regards,"
|
||||
signature: "JamKazam Team"
|
||||
app_download_reminder2:
|
||||
subject: "Take 2 minutes to get the free JamKazam app now & connect with other musicians"
|
||||
greeting: "Hello"
|
||||
paragraph1: "We share your profile with JamKazam members who may be a good fit to play music with you during your first week on the platform via an automated email feature. Don’t miss this opportunity to get connected!"
|
||||
paragraph2: "One of the critical pieces of information in getting you connected is your latency to other musicians on JamKazam (this is the amount of time it takes to get your audio to them). To get this information, you need to download and install the JamKazam app, and then open it and let it run for about 15 minutes. During this time, the app will run Internet tests that measure your latency to other musicians on our platform."
|
||||
paragraph3: "To go to the app download page, most users should click the Download App button below, with these exceptions:"
|
||||
paragraph3_list_item1: "If you’re on a Mac that can’t run MacOS 10.15 or later, click the Download Legacy App button, as that version of the app supports older MacOS versions back to 10.7."
|
||||
paragraph3_list_item2: "If you’re on Windows 7, click the Download Legacy App button, as that version of the app supports Windows 7 computers."
|
||||
download_app: "Download App"
|
||||
download_legacy_app: "Download Legacy App"
|
||||
paragraph4: "After downloading, double click the downloaded installer, and then follow the on-screen instructions to install the app."
|
||||
paragraph5: "For next steps after downloading and installing the app, don’t forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. We’re always happy to help!"
|
||||
regards: "Best Regards,"
|
||||
signature: "JamKazam Team"
|
||||
app_download_reminder3:
|
||||
subject: "Don’t waste your free 30-day premium gold plan, get the JamKazam app now!"
|
||||
greeting: "Hello"
|
||||
paragraph1: "When you sign up for JamKazam, we give you a free 30-day premium gold plan so you can fully experience how amazing our online sessions are and how JamKazam can help you play more music with more people to bring more musical joy to your life."
|
||||
paragraph2: "Don’t waste your 30-day window! Get the free JamKazam app now and get started. To go to the app download page, most users should click the Download App button below, with these exceptions:"
|
||||
paragraph2_list_item1: "If you’re on a Mac that can’t run MacOS 10.15 or later, click the Download Legacy App button, as that version of the app supports older MacOS versions back to 10.7."
|
||||
paragraph2_list_item2: "If you’re on Windows 7, click the Download Legacy App button, as that version of the app supports Windows 7 computers."
|
||||
download_app: "Download App"
|
||||
download_legacy_app: "Download Legacy App"
|
||||
paragraph3: "After downloading, double click the downloaded installer, and then follow the on-screen instructions to install the app."
|
||||
paragraph4: "For next steps after downloading and installing the app, don’t forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. We’re always happy to help!"
|
||||
regards: "Best Regards,"
|
||||
signature: "JamKazam Team"
|
||||
Loading…
Reference in New Issue