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:
parent
075fb76a60
commit
e6f74c63db
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Add table
Reference in a new issue