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

Fixed post serialization for test emails

no issue
This commit is contained in:
Rish 2019-11-26 11:59:41 +05:30
parent 075fb76a60
commit e6f74c63db
2 changed files with 3 additions and 3 deletions

View file

@ -58,9 +58,8 @@ module.exports = {
message: common.i18n.t('errors.api.posts.postNotFound')
});
}
const post = model.toJSON();
const {emails = []} = frame.data;
const response = await mega.mega.sendTestEmail(post, emails);
const response = await mega.mega.sendTestEmail(model, emails);
if (response && response[0] && response[0].error) {
throw new common.errors.EmailError({
message: response[0].error.message

View file

@ -34,7 +34,8 @@ const sendEmail = async (post, members) => {
return bulkEmailService.send(emailTmpl, emails, emailData);
};
const sendTestEmail = async (post, emails) => {
const sendTestEmail = async (postModel, emails) => {
const post = await serialize(postModel);
const {emailTmpl} = getEmailData(post);
const emailData = emails.reduce((emailData, email) => {
return Object.assign({