mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed posts and email wrappers in worker threads
refs https://ghost.slack.com/archives/C02G9E68C/p1679055933852679 - The posts api is used in the update-check job. This also uses the email wrapper, which needs the email-service - The email service is not initalized in the worker threads, this causes an error - Adds a check, because this part is optional in worker threads
This commit is contained in:
parent
9bdffdf89d
commit
f67b38daf4
1 changed files with 2 additions and 1 deletions
|
@ -7,7 +7,8 @@ module.exports = (model, frame) => {
|
||||||
|
|
||||||
// Ensure we're not outputting unwanted replacement strings when viewing email contents
|
// Ensure we're not outputting unwanted replacement strings when viewing email contents
|
||||||
// TODO: extract this to a utility, it's duplicated in the email-preview API controller
|
// TODO: extract this to a utility, it's duplicated in the email-preview API controller
|
||||||
if (jsonModel.html) {
|
if (jsonModel.html && emailService.renderer && emailService.service) {
|
||||||
|
// In worker threads the renderer and servie service are not available, but we don't need to do this, so okay to skip.
|
||||||
const replacements = emailService.renderer.buildReplacementDefinitions({html: jsonModel.html, newsletterUuid: 'preview'});
|
const replacements = emailService.renderer.buildReplacementDefinitions({html: jsonModel.html, newsletterUuid: 'preview'});
|
||||||
const exampleMember = emailService.service.getDefaultExampleMember();
|
const exampleMember = emailService.service.getDefaultExampleMember();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue