From 92ff06e8b09317371b412b0ac8e94e3666789811 Mon Sep 17 00:00:00 2001 From: Allan Joston Fernandes Date: Sun, 6 Oct 2024 23:06:46 +0530 Subject: [PATCH 1/5] feat: add user invitation email template --- .../src/mail/services/interface.service.ts | 9 + apps/api/src/mail/services/mail.service.ts | 184 ++++++++++++++++++ apps/api/src/mail/services/mock.service.ts | 13 ++ 3 files changed, 206 insertions(+) diff --git a/apps/api/src/mail/services/interface.service.ts b/apps/api/src/mail/services/interface.service.ts index 7f4e2689..53178b77 100644 --- a/apps/api/src/mail/services/interface.service.ts +++ b/apps/api/src/mail/services/interface.service.ts @@ -18,4 +18,13 @@ export interface IMailService { adminUserCreateEmail(email: string): Promise feedbackEmail(email: string, feedback: string): Promise + + userInvitation( + email: string, + projectName: string, + projectUrl: string, + invitedBy: string, + invitedOn: string, + invitationRole: string + ): Promise } diff --git a/apps/api/src/mail/services/mail.service.ts b/apps/api/src/mail/services/mail.service.ts index d216f705..6e615f7d 100644 --- a/apps/api/src/mail/services/mail.service.ts +++ b/apps/api/src/mail/services/mail.service.ts @@ -158,6 +158,190 @@ export class MailService implements IMailService { await this.sendEmail(email, subject, body) } + async userInvitation( + email: string, + projectName: string, + projectUrl: string, + invitedBy: string, + invitedOn: string, + invitationRole: string + ): Promise { + const subject = `You're Invited to Join ${projectName} on Keyshade` + const body = ` + + + + + Project Invitation + + + + + + + + + + + + + + ` + + await this.sendEmail(email, subject, body) + } + private async sendEmail( email: string, subject: string, diff --git a/apps/api/src/mail/services/mock.service.ts b/apps/api/src/mail/services/mock.service.ts index 003cb520..f874651b 100644 --- a/apps/api/src/mail/services/mock.service.ts +++ b/apps/api/src/mail/services/mock.service.ts @@ -38,4 +38,17 @@ export class MockMailService implements IMailService { async sendEmailChangedOtp(email: string, otp: string): Promise { this.log.log(`Email change OTP for email ${email} is ${otp}`) } + + async userInvitation( + email: string, + projectName: string, + projectUrl: string, + invitedBy: string, + invitedOn: string, + invitationRole: string + ): Promise { + this.log.log( + `User ${email} has been invited to the project ${projectName} by ${invitedBy} on ${invitedOn} as a ${invitationRole}. Project details can be accessed at ${projectUrl}.` + ) + } } From 55417543facde30d9da35f47211fb0a08c5d7f1f Mon Sep 17 00:00:00 2001 From: Allan Joston Fernandes Date: Thu, 5 Dec 2024 21:48:14 +0530 Subject: [PATCH 2/5] feat: implemented workspace invitation email template & corresponding mail service --- .../src/mail/emails/workspace-invitation.tsx | 130 ++++++++++ .../api/src/mail/emails/workspace-removal.tsx | 74 +----- .../src/mail/services/interface.service.ts | 16 +- apps/api/src/mail/services/mail.service.ts | 227 ++---------------- apps/api/src/mail/services/mock.service.ts | 26 +- apps/api/src/mail/styles/common-styles.ts | 78 ++++++ .../service/workspace-membership.service.ts | 6 +- 7 files changed, 254 insertions(+), 303 deletions(-) create mode 100644 apps/api/src/mail/emails/workspace-invitation.tsx create mode 100644 apps/api/src/mail/styles/common-styles.ts diff --git a/apps/api/src/mail/emails/workspace-invitation.tsx b/apps/api/src/mail/emails/workspace-invitation.tsx new file mode 100644 index 00000000..1ad5c21d --- /dev/null +++ b/apps/api/src/mail/emails/workspace-invitation.tsx @@ -0,0 +1,130 @@ +import * as React from 'react' +import { + Body, + Button, + Container, + Head, + Heading, + Html, + Link, + Preview, + Section, + Text +} from '@react-email/components' +import dayjs from 'dayjs' +import { + container, + content, + ctaButton, + footer, + footerText, + h1, + link, + main, + text, + workspaceDetails, + workspaceInfo +} from '../styles/common-styles' + +interface WorkspaceInvitationEmailProps { + projectName: string + projectUrl: string + invitedBy: string + invitedOn: string + forRegisteredUser: boolean +} + +export const WorkspaceInvitationEmail = ({ + projectName, + projectUrl, + invitedBy, + invitedOn, + forRegisteredUser +}: WorkspaceInvitationEmailProps) => { + const formattedInvitedOnDate = dayjs(invitedOn).format( + 'ddd, MMM D, YYYY h:mm A' + ) + + return ( + + + + {forRegisteredUser + ? 'Welcome Back! Join Your Workspace' + : 'You are Invited to Join the Workspace'} + + + +
+ + {forRegisteredUser + ? 'Welcome Back! Join Your Workspace' + : 'You are Invited to Join the Workspace'} + + Dear User, + + We're excited to inform you that you've been invited to join a + project on Keyshade. Here are the details of your invitation: + +
+ + Workspace Name: {projectName} + + + Invited By: {invitedBy} + + + Invited On: {invitedOn} + + + Invited On: {formattedInvitedOnDate} + +
+ + Join the project by clicking the button below - we're excited to + have you! + + + + If you believe this action was taken in error or have any + questions regarding this change, please contact your project + administrator or our support team. + + + We appreciate your understanding and thank you for your + contributions to the project. + + + Cheers, +
+ Team Keyshade +
+
+
+ + This is an automated message. Please do not reply to this email. + + + Read our{' '} + + Privacy Policy + {' '} + and{' '} + + Terms and Conditions + {' '} + for more information on how we manage your data and services. + +
+
+ + + ) +} + +export default WorkspaceInvitationEmail diff --git a/apps/api/src/mail/emails/workspace-removal.tsx b/apps/api/src/mail/emails/workspace-removal.tsx index da1ed0aa..27bfcb5d 100644 --- a/apps/api/src/mail/emails/workspace-removal.tsx +++ b/apps/api/src/mail/emails/workspace-removal.tsx @@ -11,6 +11,18 @@ import { Text } from '@react-email/components' import dayjs from 'dayjs' +import { + container, + content, + footer, + footerText, + h1, + link, + main, + text, + workspaceDetails, + workspaceInfo +} from '../styles/common-styles' interface WorkspaceRemovalEmailProps { workspaceName: string @@ -87,65 +99,3 @@ export const RemovedFromWorkspaceEmail = ({ } export default RemovedFromWorkspaceEmail - -const main = { - fontFamily: "'Segoe UI', 'Roboto', sans-serif", - lineHeight: '1.6', - color: '#04050a', - backgroundColor: '#fafafa', - margin: '0', - padding: '20px' -} - -const container = { - maxWidth: '600px', - margin: '0 auto', - backgroundColor: '#fff', - borderRadius: '5px', - boxShadow: '0 2px 8px rgba(0, 0, 0, 0.05)' -} - -const content = { - padding: '20px 40px' -} - -const h1 = { - color: '#000', - marginBottom: '20px', - fontSize: '24px', - fontWeight: '600' -} - -const text = { - marginBottom: '5px', - color: '#666' -} - -const workspaceDetails = { - width: '100%', - backgroundColor: '#fafafa', - borderRadius: '5px', - margin: '20px 0px', - padding: '10px 20px' -} - -const workspaceInfo = { - margin: '7px 0px' -} - -const footer = { - borderTop: '1px solid #eaeaea', - padding: '20px' -} - -const footerText = { - fontSize: '12px', - color: '#999', - textAlign: 'center' as const, - margin: '0' -} - -const link = { - color: '#000', - textDecoration: 'underline' -} diff --git a/apps/api/src/mail/services/interface.service.ts b/apps/api/src/mail/services/interface.service.ts index 0808d2f4..a6a30c44 100644 --- a/apps/api/src/mail/services/interface.service.ts +++ b/apps/api/src/mail/services/interface.service.ts @@ -5,11 +5,12 @@ export interface IMailService { sendEmailChangedOtp(email: string, otp: string): Promise - workspaceInvitationMailForUsers( + invitedToWorkspace( email: string, - workspace: string, - actionUrl: string, + projectName: string, + projectUrl: string, invitedBy: string, + invitedOn: string, forRegisteredUser: boolean ): Promise @@ -19,15 +20,6 @@ export interface IMailService { feedbackEmail(email: string, feedback: string): Promise - userInvitation( - email: string, - projectName: string, - projectUrl: string, - invitedBy: string, - invitedOn: string, - invitationRole: string - ): Promise - removedFromWorkspace( email: string, workspaceName: string, diff --git a/apps/api/src/mail/services/mail.service.ts b/apps/api/src/mail/services/mail.service.ts index c041f3a3..16a5422e 100644 --- a/apps/api/src/mail/services/mail.service.ts +++ b/apps/api/src/mail/services/mail.service.ts @@ -7,6 +7,7 @@ import { IMailService } from './interface.service' import { Transporter, createTransport } from 'nodemailer' import RemovedFromWorkspaceEmail from '../emails/workspace-removal' import { render } from '@react-email/render' +import WorkspaceInvitationEmail from '../emails/workspace-invitation' @Injectable() export class MailService implements IMailService { @@ -24,33 +25,27 @@ export class MailService implements IMailService { } }) } - async workspaceInvitationMailForUsers( + async invitedToWorkspace( email: string, - workspace: string, - actionUrl: string, - invitee: string, + projectName: string, + projectUrl: string, + invitedBy: string, + invitedOn: string, forRegisteredUser: boolean ): Promise { - const subject = `You have been invited to a ${workspace}` - const intro = forRegisteredUser - ? `Hello again! You've been invited to join a new workspace.` - : `Hello there! We're excited to welcome you to Keyshade.` - const body = ` - - - Workspace Invitation - - -

Welcome to keyshade!

-

${intro}

-

You have been invited to join the workspace ${workspace} by ${invitee}.

-

Please click on the link below to accept the invitation.

-

Accept Invitation

-

Thank you for choosing us.

-

Best Regards,

-

keyshade Team

- - ` + const subject = forRegisteredUser + ? 'Welcome Back! Join Your Workspace' + : 'You are Invited to Join the Workspace' + + const body = await render( + WorkspaceInvitationEmail({ + projectName, + projectUrl, + invitedBy, + invitedOn, + forRegisteredUser + }) + ) await this.sendEmail(email, subject, body) } @@ -160,190 +155,6 @@ export class MailService implements IMailService { await this.sendEmail(email, subject, body) } - async userInvitation( - email: string, - projectName: string, - projectUrl: string, - invitedBy: string, - invitedOn: string, - invitationRole: string - ): Promise { - const subject = `You're Invited to Join ${projectName} on Keyshade` - const body = ` - - - - - Project Invitation - - - - - - - - - - - - - - ` - - await this.sendEmail(email, subject, body) - } - async removedFromWorkspace( email: string, workspaceName: string, diff --git a/apps/api/src/mail/services/mock.service.ts b/apps/api/src/mail/services/mock.service.ts index 4cf1f265..0284e248 100644 --- a/apps/api/src/mail/services/mock.service.ts +++ b/apps/api/src/mail/services/mock.service.ts @@ -5,17 +5,18 @@ import { IMailService } from './interface.service' export class MockMailService implements IMailService { private readonly log = new Logger(MockMailService.name) - async workspaceInvitationMailForUsers( + async invitedToWorkspace( email: string, - workspace: string, - actionUrl: string, - invitee: string, + projectName: string, + projectUrl: string, + invitedBy: string, + invitedOn: string, forRegisteredUser: boolean ): Promise { this.log.log( forRegisteredUser - ? `Workspace Invitation Mail for Registered User: ${email}, ${workspace}, ${actionUrl}, ${invitee}` - : `Workspace Invitation Mail for Non Registered User: ${email}, ${workspace}, ${actionUrl}, ${invitee}` + ? `User ${email} has been invited to the workspace ${projectName} by ${invitedBy} on ${invitedOn}. Invitation details can be accessed at ${projectUrl}.` + : `User ${email} has been invited to the workspace ${projectName} by ${invitedBy} on ${invitedOn}. Since the user is not registered, they can sign up and access the invitation details at ${projectUrl}.` ) } @@ -39,19 +40,6 @@ export class MockMailService implements IMailService { this.log.log(`Email change OTP for email ${email} is ${otp}`) } - async userInvitation( - email: string, - projectName: string, - projectUrl: string, - invitedBy: string, - invitedOn: string, - invitationRole: string - ): Promise { - this.log.log( - `User ${email} has been invited to the project ${projectName} by ${invitedBy} on ${invitedOn} as a ${invitationRole}. Project details can be accessed at ${projectUrl}.` - ) - } - async removedFromWorkspace( email: string, workspaceName: string, diff --git a/apps/api/src/mail/styles/common-styles.ts b/apps/api/src/mail/styles/common-styles.ts new file mode 100644 index 00000000..027deedb --- /dev/null +++ b/apps/api/src/mail/styles/common-styles.ts @@ -0,0 +1,78 @@ +import { CSSProperties } from 'react' + +export const main: CSSProperties = { + fontFamily: "'Segoe UI', 'Roboto', sans-serif", + lineHeight: '1.6', + color: '#04050a', + backgroundColor: '#fafafa', + margin: '0', + padding: '20px' +} + +export const container: CSSProperties = { + maxWidth: '600px', + margin: '0 auto', + backgroundColor: '#fff', + borderRadius: '5px', + boxShadow: '0 2px 8px rgba(0, 0, 0, 0.05)' +} + +export const content: CSSProperties = { + padding: '20px 40px' +} + +export const h1: CSSProperties = { + color: '#000', + marginBottom: '20px', + fontSize: '24px', + fontWeight: '600' +} + +export const text: CSSProperties = { + marginBottom: '5px', + color: '#666' +} + +export const workspaceDetails: CSSProperties = { + width: '100%', + backgroundColor: '#fafafa', + borderRadius: '5px', + margin: '20px 0px', + padding: '10px 20px' +} + +export const workspaceInfo: CSSProperties = { + margin: '7px 0px' +} + +export const ctaButton: CSSProperties = { + width: '100px', + color: '#ffffff', + fontSize: '14px', + fontWeight: '500', + textAlign: 'center', + marginTop: '10px', + cursor: 'pointer', + display: 'inline-block', + backgroundColor: '#000', + textDecoration: 'none', + padding: '10px 22px', + borderRadius: '5px' +} + +export const footer: CSSProperties = { + borderTop: '1px solid #eaeaea', + padding: '20px' +} + +export const footerText: CSSProperties = { + fontSize: '12px', + color: '#999', + textAlign: 'center' as const, + margin: '0' +} + +export const link: CSSProperties = { + color: '#000', + textDecoration: 'underline' +} diff --git a/apps/api/src/workspace-membership/service/workspace-membership.service.ts b/apps/api/src/workspace-membership/service/workspace-membership.service.ts index e9f07e3d..d10032c5 100644 --- a/apps/api/src/workspace-membership/service/workspace-membership.service.ts +++ b/apps/api/src/workspace-membership/service/workspace-membership.service.ts @@ -899,11 +899,12 @@ export class WorkspaceMembershipService { if (memberUser) { await this.prisma.$transaction([createMembership]) - this.mailService.workspaceInvitationMailForUsers( + this.mailService.invitedToWorkspace( member.email, workspace.name, `${process.env.WORKSPACE_FRONTEND_URL}/workspace/${workspace.slug}/join`, currentUser.name, + new Date().toISOString(), true ) @@ -925,7 +926,7 @@ export class WorkspaceMembershipService { this.log.debug(`Created non-registered user ${memberUser}`) - this.mailService.workspaceInvitationMailForUsers( + this.mailService.invitedToWorkspace( member.email, workspace.name, `${process.env.WORKSPACE_FRONTEND_URL}/workspace/${ @@ -934,6 +935,7 @@ export class WorkspaceMembershipService { id: userId })}`, currentUser.name, + new Date().toISOString(), false ) From 80238eeaedf2706d17780dc3d4cfd266c0d679ce Mon Sep 17 00:00:00 2001 From: Allan Joston Fernandes Date: Fri, 6 Dec 2024 21:05:43 +0530 Subject: [PATCH 3/5] fix: renamed projectName to workspaceName & projectUrl to actionUrl --- apps/api/src/mail/emails/workspace-invitation.tsx | 12 ++++++------ apps/api/src/mail/services/interface.service.ts | 2 +- apps/api/src/mail/services/mail.service.ts | 8 ++++---- apps/api/src/mail/services/mock.service.ts | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/api/src/mail/emails/workspace-invitation.tsx b/apps/api/src/mail/emails/workspace-invitation.tsx index 1ad5c21d..0fd5bf60 100644 --- a/apps/api/src/mail/emails/workspace-invitation.tsx +++ b/apps/api/src/mail/emails/workspace-invitation.tsx @@ -27,16 +27,16 @@ import { } from '../styles/common-styles' interface WorkspaceInvitationEmailProps { - projectName: string - projectUrl: string + workspaceName: string + actionUrl: string invitedBy: string invitedOn: string forRegisteredUser: boolean } export const WorkspaceInvitationEmail = ({ - projectName, - projectUrl, + workspaceName, + actionUrl, invitedBy, invitedOn, forRegisteredUser @@ -68,7 +68,7 @@ export const WorkspaceInvitationEmail = ({
- Workspace Name: {projectName} + Workspace Name: {workspaceName} Invited By: {invitedBy} @@ -84,7 +84,7 @@ export const WorkspaceInvitationEmail = ({ Join the project by clicking the button below - we're excited to have you! - diff --git a/apps/api/src/mail/services/interface.service.ts b/apps/api/src/mail/services/interface.service.ts index a6a30c44..a600be93 100644 --- a/apps/api/src/mail/services/interface.service.ts +++ b/apps/api/src/mail/services/interface.service.ts @@ -7,7 +7,7 @@ export interface IMailService { invitedToWorkspace( email: string, - projectName: string, + workspaceName: string, projectUrl: string, invitedBy: string, invitedOn: string, diff --git a/apps/api/src/mail/services/mail.service.ts b/apps/api/src/mail/services/mail.service.ts index 16a5422e..3a7dca54 100644 --- a/apps/api/src/mail/services/mail.service.ts +++ b/apps/api/src/mail/services/mail.service.ts @@ -27,8 +27,8 @@ export class MailService implements IMailService { } async invitedToWorkspace( email: string, - projectName: string, - projectUrl: string, + workspaceName: string, + actionUrl: string, invitedBy: string, invitedOn: string, forRegisteredUser: boolean @@ -39,8 +39,8 @@ export class MailService implements IMailService { const body = await render( WorkspaceInvitationEmail({ - projectName, - projectUrl, + workspaceName, + actionUrl, invitedBy, invitedOn, forRegisteredUser diff --git a/apps/api/src/mail/services/mock.service.ts b/apps/api/src/mail/services/mock.service.ts index 0284e248..3513313e 100644 --- a/apps/api/src/mail/services/mock.service.ts +++ b/apps/api/src/mail/services/mock.service.ts @@ -7,16 +7,16 @@ export class MockMailService implements IMailService { async invitedToWorkspace( email: string, - projectName: string, - projectUrl: string, + workspaceName: string, + actionUrl: string, invitedBy: string, invitedOn: string, forRegisteredUser: boolean ): Promise { this.log.log( forRegisteredUser - ? `User ${email} has been invited to the workspace ${projectName} by ${invitedBy} on ${invitedOn}. Invitation details can be accessed at ${projectUrl}.` - : `User ${email} has been invited to the workspace ${projectName} by ${invitedBy} on ${invitedOn}. Since the user is not registered, they can sign up and access the invitation details at ${projectUrl}.` + ? `User ${email} has been invited to the workspace ${workspaceName} by ${invitedBy} on ${invitedOn}. Invitation details can be accessed at ${actionUrl}.` + : `User ${email} has been invited to the workspace ${workspaceName} by ${invitedBy} on ${invitedOn}. Since the user is not registered, they can sign up and access the invitation details at ${actionUrl}.` ) } From f609d29d96cad3b3a4ee3a8aa4cf4f2d34a0c46c Mon Sep 17 00:00:00 2001 From: Allan Joston Fernandes Date: Fri, 6 Dec 2024 21:29:15 +0530 Subject: [PATCH 4/5] feat: created a reusable base email template component --- .../emails/components/base-email-template.tsx | 84 +++++++++++ .../mail/{ => emails}/styles/common-styles.ts | 0 .../src/mail/emails/workspace-invitation.tsx | 135 +++++------------- .../api/src/mail/emails/workspace-removal.tsx | 103 +++---------- 4 files changed, 142 insertions(+), 180 deletions(-) create mode 100644 apps/api/src/mail/emails/components/base-email-template.tsx rename apps/api/src/mail/{ => emails}/styles/common-styles.ts (100%) diff --git a/apps/api/src/mail/emails/components/base-email-template.tsx b/apps/api/src/mail/emails/components/base-email-template.tsx new file mode 100644 index 00000000..891ddfe0 --- /dev/null +++ b/apps/api/src/mail/emails/components/base-email-template.tsx @@ -0,0 +1,84 @@ +import * as React from 'react' +import { + Body, + Container, + Head, + Heading, + Html, + Link, + Preview, + Section, + Text +} from '@react-email/components' +import { + container, + content, + footer, + footerText, + h1, + link, + main, + text +} from '../styles/common-styles' + +interface BaseEmailTemplateProps { + previewText: string + heading: string + children: React.ReactNode +} + +export const BaseEmailTemplate: React.FC = ({ + previewText, + heading, + children +}) => { + return ( + + + {previewText} + + +
+ {heading} + {children} + + If you believe this action was taken in error or have any + questions regarding this change, please contact your project + administrator or our support team. + + + We appreciate your understanding and thank you for your + contributions to the project. + + + Cheers, +
+ Team Keyshade +
+
+
+ + This is an automated message. Please do not reply to this email. + + + Read our{' '} + + Privacy Policy + {' '} + and{' '} + + Terms and Conditions + {' '} + for more information on how we manage your data and services. + +
+
+ + + ) +} + +export default BaseEmailTemplate \ No newline at end of file diff --git a/apps/api/src/mail/styles/common-styles.ts b/apps/api/src/mail/emails/styles/common-styles.ts similarity index 100% rename from apps/api/src/mail/styles/common-styles.ts rename to apps/api/src/mail/emails/styles/common-styles.ts diff --git a/apps/api/src/mail/emails/workspace-invitation.tsx b/apps/api/src/mail/emails/workspace-invitation.tsx index 0fd5bf60..4f8cfcd9 100644 --- a/apps/api/src/mail/emails/workspace-invitation.tsx +++ b/apps/api/src/mail/emails/workspace-invitation.tsx @@ -1,30 +1,13 @@ import * as React from 'react' -import { - Body, - Button, - Container, - Head, - Heading, - Html, - Link, - Preview, - Section, - Text -} from '@react-email/components' +import { Button, Section, Text } from '@react-email/components' import dayjs from 'dayjs' import { - container, - content, ctaButton, - footer, - footerText, - h1, - link, - main, text, workspaceDetails, workspaceInfo -} from '../styles/common-styles' +} from './styles/common-styles' +import BaseEmailTemplate from './components/base-email-template' interface WorkspaceInvitationEmailProps { workspaceName: string @@ -45,86 +28,40 @@ export const WorkspaceInvitationEmail = ({ 'ddd, MMM D, YYYY h:mm A' ) + const previewText = forRegisteredUser + ? 'Welcome Back! Join Your Workspace' + : 'You are Invited to Join the Workspace' + return ( - - - - {forRegisteredUser - ? 'Welcome Back! Join Your Workspace' - : 'You are Invited to Join the Workspace'} - - - -
- - {forRegisteredUser - ? 'Welcome Back! Join Your Workspace' - : 'You are Invited to Join the Workspace'} - - Dear User, - - We're excited to inform you that you've been invited to join a - project on Keyshade. Here are the details of your invitation: - -
- - Workspace Name: {workspaceName} - - - Invited By: {invitedBy} - - - Invited On: {invitedOn} - - - Invited On: {formattedInvitedOnDate} - -
- - Join the project by clicking the button below - we're excited to - have you! - - - - If you believe this action was taken in error or have any - questions regarding this change, please contact your project - administrator or our support team. - - - We appreciate your understanding and thank you for your - contributions to the project. - - - Cheers, -
- Team Keyshade -
-
-
- - This is an automated message. Please do not reply to this email. - - - Read our{' '} - - Privacy Policy - {' '} - and{' '} - - Terms and Conditions - {' '} - for more information on how we manage your data and services. - -
-
- - + + Dear User, + + We're excited to inform you that you've been invited to join a + project on Keyshade. Here are the details of your invitation: + +
+ + Workspace Name: {workspaceName} + + + Invited By: {invitedBy} + + + Invited On: {formattedInvitedOnDate} + +
+ + Join the project by clicking the button below - we're excited to + have you! + + +
) } -export default WorkspaceInvitationEmail +export default WorkspaceInvitationEmail \ No newline at end of file diff --git a/apps/api/src/mail/emails/workspace-removal.tsx b/apps/api/src/mail/emails/workspace-removal.tsx index 27bfcb5d..29a28693 100644 --- a/apps/api/src/mail/emails/workspace-removal.tsx +++ b/apps/api/src/mail/emails/workspace-removal.tsx @@ -1,28 +1,8 @@ import * as React from 'react' -import { - Body, - Container, - Head, - Heading, - Html, - Link, - Preview, - Section, - Text -} from '@react-email/components' +import { Text, Section } from '@react-email/components' import dayjs from 'dayjs' -import { - container, - content, - footer, - footerText, - h1, - link, - main, - text, - workspaceDetails, - workspaceInfo -} from '../styles/common-styles' +import { text, workspaceDetails, workspaceInfo } from './styles/common-styles' +import BaseEmailTemplate from './components/base-email-template' interface WorkspaceRemovalEmailProps { workspaceName: string @@ -38,64 +18,25 @@ export const RemovedFromWorkspaceEmail = ({ ) return ( - - - Removal from Workspace - - -
- Removal from Workspace - Dear User, - - We hope this email finds you well. We are writing to inform you - that your access to the following workspace has been removed: - -
- - Workspace Name: {workspaceName} - - - Removed On: {formattedRemovedOnDate} - -
- - If you believe this action was taken in error or have any - questions regarding this change, please contact your project - administrator or our support team. - - - We appreciate your understanding and thank you for your - contributions to the project. - - - Cheers, -
- Team Keyshade -
-
-
- - This is an automated message. Please do not reply to this email. - - - Read our{' '} - - Privacy Policy - {' '} - and{' '} - - Terms and Conditions - {' '} - for more information on how we manage your data and services. - -
-
- - + + Dear User, + + We hope this email finds you well. We are writing to inform you + that your access to the following workspace has been removed: + +
+ + Workspace Name: {workspaceName} + + + Removed On: {formattedRemovedOnDate} + +
+
) } -export default RemovedFromWorkspaceEmail +export default RemovedFromWorkspaceEmail \ No newline at end of file From a2d79d758ebf1af728225508d471e68d7ca2772c Mon Sep 17 00:00:00 2001 From: Allan Joston Fernandes Date: Fri, 6 Dec 2024 21:41:05 +0530 Subject: [PATCH 5/5] fix: replaced term project with workspace --- apps/api/src/mail/emails/workspace-invitation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/mail/emails/workspace-invitation.tsx b/apps/api/src/mail/emails/workspace-invitation.tsx index 4f8cfcd9..37b4fc0f 100644 --- a/apps/api/src/mail/emails/workspace-invitation.tsx +++ b/apps/api/src/mail/emails/workspace-invitation.tsx @@ -40,7 +40,7 @@ export const WorkspaceInvitationEmail = ({ Dear User, We're excited to inform you that you've been invited to join a - project on Keyshade. Here are the details of your invitation: + workspace on Keyshade. Here are the details of your invitation: