Skip to content

Commit 71ff7b8

Browse files
author
David Lenton
committed
Merged in remove-email-notification-links (pull request auth0#27)
Replaces links with note to read more in the app
2 parents d85617b + 94b79f4 commit 71ff7b8

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

app.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,11 @@ queue.process('ask', (job, done) => {
751751
false,
752752
(err) => {
753753
if (err) return done(err);
754-
q.sendEmail(job.data, (err) => {
755-
return done(err);
756-
});
754+
return done();
755+
// Temporarily disable ASK email notifications
756+
// q.sendEmail(job.data, (err) => {
757+
// return done(err);
758+
// });
757759
}
758760
);
759761
});
@@ -787,10 +789,12 @@ queue.process('ask', (job, done) => {
787789
// Send email notifications
788790
if (err) return done(err);
789791
if (!job.data.sendemail) return done();
790-
q.sendEmail(job.data, (err) => {
791-
if (err) debug(err);
792-
return done(null);
793-
});
792+
return done();
793+
// Temporarily disable ASK email notifications
794+
// q.sendEmail(job.data, (err) => {
795+
// if (err) debug(err);
796+
// return done(null);
797+
// });
794798
}
795799
);
796800
} else {

models/queue.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,17 @@ function constructEmail(options, done) {
9595
link = options.protocol + '://' + options.hostname + '/community/#ask_' + options.ask.id;
9696
if (options.ask.type === 2)
9797
link = options.protocol + '://' + options.hostname + '/community/#ask_' + options.ask.ask_id;
98-
text = text + '<p>Read more here: <a href="' + link + '">' + link + '</a></p>';
99-
// title = 'ASK: ' + type;
100-
console.log(text);
98+
// Temporarily disable link until deep linking works
99+
//text = text + '<p>Read more here: <a href="' + link + '">' + link + '</a></p>';
100+
text = text + '<p>Read more in the app</p>';
101101
}
102102
if (options.subject) {
103103
const s = options.subject;
104104
link = options.protocol + '://' + options.hostname + '/subject/' + s.id + '/';
105-
text = s.intro + '<p>Read the full article here: <a href="' + link + '">' + link + '</a></p>';
106-
// title = s.title;
105+
text = s.intro;
106+
// Temporarily disable link until deep linking works
107+
// text = text + '<p>Read the full article here: <a href="' + link + '">' + link + '</a></p>';
108+
text = text + '<p>Read more in the app<p>';
107109
}
108110
// HTML text
109111
let htmlText = '';
@@ -197,7 +199,7 @@ function sendEmail(options, done) {
197199
options.profiles.forEach((profile) => {
198200
audiences.push(profile.profile_id);
199201
});
200-
db.get().query('SELECT DISTINCT account.email FROM clcdc.account_profile_settings INNER JOIN account ON account_profile_settings.account_id = account.id WHERE account.client_id = ? AND notifications_sendemail = 1 AND notifications_on = 1 AND profile_id IN (?) AND account.send_email = 1', [options.appId, audiences], (err, results) => {
202+
db.get().query('SELECT DISTINCT account.email FROM clcdc.account_profile_settings INNER JOIN account ON account_profile_settings.account_id = account.id WHERE account.client_id = ? AND notifications_sendemail = 1 AND notifications_on = 1 AND profile_id IN (?) AND account.sendemail = 1', [options.appId, audiences], (err, results) => {
201203
if (err) return done(err);
202204
if (results.length > 0) {
203205
constructEmail(options, (msg) => {

0 commit comments

Comments
 (0)