-
Notifications
You must be signed in to change notification settings - Fork 0
Changed member welcome email job to run based on config #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cursor_full_base_changed_member_welcome_email_job_to_run_based_on_config_pr6
Are you sure you want to change the base?
Changes from all commits
120efae
2ac7b59
3fedc84
f2429b3
bc7e716
bde2541
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ const ObjectId = require('bson-objectid').default; | |
| const {NotFoundError} = require('@tryghost/errors'); | ||
| const validator = require('@tryghost/validator'); | ||
| const crypto = require('crypto'); | ||
| const config = require('../../../../../shared/config'); | ||
|
|
||
| const messages = { | ||
| noStripeConnection: 'Cannot {action} without a Stripe Connection', | ||
|
|
@@ -336,8 +337,9 @@ module.exports = class MemberRepository { | |
| const eventData = _.pick(data, ['created_at']); | ||
|
|
||
| const memberAddOptions = {...(options || {}), withRelated}; | ||
| let member; | ||
| if (this._labsService.isSet('welcomeEmails') && WELCOME_EMAIL_SOURCES.includes(source)) { | ||
| var member; | ||
| const welcomeEmailConfig = config.get('memberWelcomeEmailTestInbox'); | ||
| if (welcomeEmailConfig || WELCOME_EMAIL_SOURCES.includes(source)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong operator breaks source filtering for outbox entriesHigh Severity The condition changed from |
||
| const runMemberCreation = async (transacting) => { | ||
| const newMember = await this._Member.add({ | ||
| ...memberData, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inverted condition prevents job from ever scheduling
High Severity
The condition
hasScheduled.processOutboxwas changed from!hasScheduled.processOutbox, causing the job to never be scheduled. SincehasScheduled.processOutboxstarts asfalse, the condition is never true, so the code block that callsjobsService.addJob()and setshasScheduled.processOutbox = trueis never executed. The welcome email processing job will never run.