diff --git a/public/email-logo.png b/public/email-logo.png new file mode 100644 index 00000000..8c5d0e92 Binary files /dev/null and b/public/email-logo.png differ diff --git a/public/email-logo.svg b/public/email-logo.svg new file mode 100644 index 00000000..5c6349da --- /dev/null +++ b/public/email-logo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/app/api/workspaces/[id]/collaborators/route.ts b/src/app/api/workspaces/[id]/collaborators/route.ts index a6276e71..332b81be 100644 --- a/src/app/api/workspaces/[id]/collaborators/route.ts +++ b/src/app/api/workspaces/[id]/collaborators/route.ts @@ -202,7 +202,9 @@ async function handlePOST( inviterName: currentUser.name || 'A user', workspaceName: ws.name || 'Workspace', workspaceUrl, + permissionLevel, }), + }); if (error) console.error("Failed to send invitation email:", error); } catch (emailError) { diff --git a/src/components/email/invite-email.tsx b/src/components/email/invite-email.tsx index bdf693e5..ce84594c 100644 --- a/src/components/email/invite-email.tsx +++ b/src/components/email/invite-email.tsx @@ -1,46 +1,171 @@ import * as React from 'react'; +const FONT = + 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'; +const BRAND_FONT = + 'Outfit, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'; +const BG = '#111113'; + interface InviteEmailTemplateProps { inviterName?: string; workspaceName: string; workspaceUrl: string; + permissionLevel?: string; } export function InviteEmailTemplate({ inviterName, workspaceName, workspaceUrl, + permissionLevel, }: Readonly): React.ReactElement { + const roleText = permissionLevel === 'viewer' ? 'a Viewer' : 'an Editor'; + return ( -
-

- You've been invited to collaborate! -

-

- {inviterName || 'Someone'} has invited you to collaborate on the workspace {workspaceName}. -

-
- - Join Workspace - -
-

- or copy and paste this link into your browser:
- - {workspaceUrl} - -

+
+ + + + +
+ + {/* Heading + Body text */} + + + + + {/* CTA Button */} + + + + + {/* Fallback URL */} + + + + + {/* Footer */} + + + +
+

+ You're invited to collaborate! +

+

+ {inviterName || 'Someone'} has invited you to join the workspace{' '} + “{workspaceName}” + {permissionLevel ? ` as ${roleText}` : ''}. +

+
+ + Join Workspace + +
+

+ or copy and paste this link into your browser: +
+ + {workspaceUrl} + +

+
+

+ The Workspace That Thinks With You +

+

+ You received this email because {inviterName || 'someone'} invited you to collaborate on ThinkEx. If you believe this was sent in error, you can safely ignore this email. +

+

+ © {new Date().getFullYear()} ThinkEx +

+
+
); }