Skip to content

Commit

Permalink
fix: Unable to send attachments via email as an omni-agent (#30525)
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza98 authored Oct 10, 2023
1 parent ef1d37a commit 4344d83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-shrimps-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fix: Unable to send attachments via email as an omni-agent
10 changes: 5 additions & 5 deletions apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ const sendErrorReplyMessage = async (error: string, options: any) => {
return sendMessage(user, message, { _id: options.rid });
};

const sendSuccessReplyMessage = async (options: any) => {
if (!options?.rid || !options?.msgId) {
const sendSuccessReplyMessage = async (options: { room: IOmnichannelRoom; msgId: string; sender: string }) => {
if (!options?.room?._id || !options?.msgId) {
return;
}
const message = {
groupable: false,
msg: `@${options.sender} Attachment was sent successfully`,
_id: String(Date.now()),
rid: options.rid,
rid: options.room._id,
ts: new Date(),
};

Expand All @@ -60,7 +60,7 @@ const sendSuccessReplyMessage = async (options: any) => {
return;
}

return sendMessage(user, message, { _id: options.rid });
return sendMessage(user, message, options.room);
};

async function sendEmail(inbox: Inbox, mail: Mail.Options, options?: any): Promise<{ messageId: string }> {
Expand Down Expand Up @@ -174,7 +174,7 @@ slashCommands.add({
return sendSuccessReplyMessage({
msgId: message._id,
sender: message.u.username,
rid: room._id,
room,
});
},
options: {
Expand Down

0 comments on commit 4344d83

Please sign in to comment.