(email: string, workspaceName: string, dashboardLink: string)
| 46 | } |
| 47 | |
| 48 | const sendWorkspaceAdd = async (email: string, workspaceName: string, dashboardLink: string) => { |
| 49 | let htmlToSend |
| 50 | let textContent |
| 51 | |
| 52 | const template = getEmailTemplate('workspace_add_cloud.hbs', process.env.WORKSPACE_INVITE_TEMPLATE_PATH) |
| 53 | const compiledWorkspaceInviteTemplateSource = handlebars.compile(template) |
| 54 | htmlToSend = compiledWorkspaceInviteTemplateSource({ workspaceName, dashboardLink }) |
| 55 | textContent = `You have been added to ${workspaceName}. Click here to visit your dashboard: ${dashboardLink}` // plain text body |
| 56 | |
| 57 | await transporter.sendMail({ |
| 58 | from: SENDER_EMAIL || '"FlowiseAI Team" <team@mail.flowiseai.com>', // sender address |
| 59 | to: email, |
| 60 | subject: `You have been added to ${workspaceName}`, // Subject line |
| 61 | text: textContent, // plain text body |
| 62 | html: htmlToSend // html body |
| 63 | }) |
| 64 | } |
| 65 | |
| 66 | const sendWorkspaceInvite = async ( |
| 67 | email: string, |
no test coverage detected