0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed emails not being sent when using new publish flow

no issue

- `this.willEmail` was changed to include the post status as we only allow sending an email for draft posts but that meant the order of operations in the save task was wrong because we checked `willEmail` _after_ changing the status on a post meaning the newsletter/recipient filter query params were never attached when publishing
This commit is contained in:
Kevin Ansfield 2022-05-09 13:54:07 +01:00
parent cae5adc6ed
commit 2768dc74ad

View file

@ -262,11 +262,15 @@ export class PublishOptions {
@task({drop: true}) @task({drop: true})
*saveTask() { *saveTask() {
// willEmail can change after model changes are applied because the post
// can leave draft status - grab it now before that happens
const willEmail = this.willEmail;
this._applyModelChanges(); this._applyModelChanges();
const adapterOptions = {}; const adapterOptions = {};
if (this.willEmail) { if (willEmail) {
adapterOptions.newsletterId = this.newsletter.id; adapterOptions.newsletterId = this.newsletter.id;
adapterOptions.emailRecipientFilter = this.recipientFilter; adapterOptions.emailRecipientFilter = this.recipientFilter;
} }