diff --git a/packages/rocketchat-mailer/server/api.js b/packages/rocketchat-mailer/server/api.js index 1a3ef0669619..d357132d58e1 100644 --- a/packages/rocketchat-mailer/server/api.js +++ b/packages/rocketchat-mailer/server/api.js @@ -81,14 +81,14 @@ export const rfcMailPatternWithName = /^(?:.*<)?([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~- export const checkAddressFormat = (from) => rfcMailPatternWithName.test(from); -export const sendNoWrap = ({ to, from, subject, html }) => { +export const sendNoWrap = ({ to, from, subject, html, headers }) => { if (!checkAddressFormat(to)) { return; } - Meteor.defer(() => Email.send({ to, from, subject, html })); + Meteor.defer(() => Email.send({ to, from, subject, html, headers })); }; -export const send = ({ to, from, subject, html, data }) => sendNoWrap({ to, from, subject: replace(subject, data), html: wrap(html, data) }); +export const send = ({ to, from, subject, html, data, headers }) => sendNoWrap({ to, from, subject: replace(subject, data), html: wrap(html, data), headers }); export const checkAddressFormatAndThrow = (from, func) => { if (checkAddressFormat(from)) {