fix: error invitation url (#4110)

This commit is contained in:
Qi 2023-09-02 02:22:26 +08:00 committed by GitHub
parent c9c76983de
commit 442d06fc69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,26 +42,35 @@ export class MailService {
};
}
) {
const buttonUrl = `${this.config.baseUrl}/invite/${inviteId}`;
// TODO: use callback url when need support desktop app
const buttonUrl = `${this.config.origin}/invite/${inviteId}`;
const workspaceAvatar = invitationInfo.workspace.avatar;
const content = ` <img
const content = `${
invitationInfo.user.avatar
? `<img
src="${invitationInfo.user.avatar}"
alt=""
width="24px"
height="24px"
style="border-radius: 12px;object-fit: cover;vertical-align: middle"
/>
<span style="font-weight:500;margin-left:4px;margin-right: 10px;">${invitationInfo.user.name}</span>
style="width:24px; height:24px; border-radius: 12px;object-fit: cover;vertical-align: middle"
/>`
: ''
}
<span style="font-weight:500;margin-left:4px;margin-right: 10px;">${
invitationInfo.user.name
}</span>
<span>invited you to join</span>
<img
src="cid:workspaceAvatar"
alt=""
width="24px"
height="24px"
style="margin-left:10px;border-radius: 12px;object-fit: cover;vertical-align: middle"
style="width:24px; height:24px; margin-left:10px;border-radius: 12px;object-fit: cover;vertical-align: middle"
/>
<span style="font-weight:500;margin-left:4px;margin-right: 10px;">${invitationInfo.workspace.name}</span>`;
<span style="font-weight:500;margin-left:4px;margin-right: 10px;">${
invitationInfo.workspace.name
}</span>`;
const html = emailTemplate({
title: 'You are invited!',