Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Merge branch 'dev' of github.com:erxes/erxes into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
munkhsaikhan committed Oct 2, 2023
2 parents bca1756 + 09f1868 commit 2e74335
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/api-utils/src/messageBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ RabbitListener.prototype.connect = function(RABBITMQ_HOST) {
console.log(`Connected to rabbitmq server ${RABBITMQ_HOST}`);

conn.on('error', me.reconnect.bind(me, RABBITMQ_HOST));
conn.on('close', me.reconnect.bind(me, RABBITMQ_HOST));

return conn.createChannel().then(function(chan) {
channel = chan;
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-engages-api/src/emailUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const prepareEmailParams = (

return {
from: `${sender} <${fromEmail}>`,
to: customer.primaryEmail.toLocaleLowerCase().trim(),
to: (customer?.primaryEmail || '').toLocaleLowerCase().trim(),
replyTo,
subject: replacedSubject,
attachments: prepareAttachments(attachments),
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-engages-api/src/sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ export const sendEmail = async (models: IModels, data: any) => {
prepareEmailParams(customer, data, configs.configSet)
);

debugEngages(`Sent email to: ${customer.primaryEmail}`);
debugEngages(`Sent email to: ${customer?.primaryEmail}`);
} catch (e) {
debugError(
`Error occurred while sending email to ${customer.primaryEmail}: ${e.message}`
`Error occurred while sending email to ${customer?.primaryEmail}: ${e.message}`
);
}
};

0 comments on commit 2e74335

Please sign in to comment.