Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 Updated transactional email templates #1285

Merged
merged 8 commits into from
Aug 30, 2024
Merged

💄 Updated transactional email templates #1285

merged 8 commits into from
Aug 30, 2024

Conversation

lukevella
Copy link
Owner

@lukevella lukevella commented Aug 29, 2024

Summary by CodeRabbit

  • New Features

    • Added support for configurable email addresses, enhancing communication capabilities.
    • Improved email context with a dedicated support email property.
    • Introduced a new heading in various email templates to enhance clarity and visual hierarchy.
  • Bug Fixes

    • Streamlined the login email component for a clearer user experience and simplified interface.
  • Style

    • Updated logo URL handling for better adaptability based on hosting environment.
    • Enhanced email layouts for improved visual appeal and organization.
  • Documentation

    • Enhanced clarity in email content, providing clearer instructions for user login processes.

Copy link

vercel bot commented Aug 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 8:18am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
landing ⬜️ Ignored (Inspect) Visit Preview Aug 30, 2024 8:18am

Copy link
Contributor

coderabbitai bot commented Aug 29, 2024

Walkthrough

The changes involve updates to several email templates and utility files, focusing on enhancing email configuration and layout. New environment variables for support and no-reply email addresses have been introduced, while existing email templates have been streamlined for clarity. Adjustments include improved logo URL handling based on hosting conditions and the removal of certain props to simplify the email structure.

Changes

Files Change Summary
apps/web/src/env.ts Added new environment variables: SUPPORT_EMAIL, NOREPLY_EMAIL, and NOREPLY_EMAIL_NAME for email configuration.
apps/web/src/utils/emails.ts Updated environment variable access to use env.NODE_ENV. Enhanced logo URL handling with conditional logic based on isSelfHosted.
packages/emails/src/templates/_components/email-context.tsx Added supportEmail property to EmailContext. Changed logoUrl from a hardcoded local URL to a public S3 bucket URL.
`packages/emails/src/templates/login.tsx Removed name prop, emphasized verification code with a new layout, and streamlined content focus.
packages/emails/src/templates/_components/email-layout.tsx Removed optional props recipientName and footNote, adjusted styles, and simplified rendering logic.
packages/emails/src/templates/_components/notification-email.tsx Removed name prop, streamlined rendering logic, and improved layout with a new Section component.
`packages/emails/src/templates/new-comment.tsx Added a Heading component to display "New Comment," enhancing visual clarity.
`packages/emails/src/templates/new-participant-confirmation.tsx Added a Heading component for "Poll Response Confirmation" and adjusted styles for better spacing.
`packages/emails/src/templates/new-participant.tsx Added a Heading component for "New Response" and included additional context with a new <Text> component.
`packages/emails/src/templates/new-poll.tsx Removed ShareLink component and name property, added a new heading, and simplified content.
`packages/emails/src/templates/register.tsx Refactored footnote into a separate Section component and added a Heading for "Verify your email address."
`packages/emails/src/templates/finalized-host.tsx Added a Heading for "Final date booked!" and wrapped the Button in a Section for better spacing.
`packages/emails/src/templates/finalized-participant.tsx Added a Heading for "Final date booked!" and streamlined props for the EmailLayout.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EmailClient
    participant EmailTemplate

    User->>EmailClient: Request email
    EmailClient->>EmailTemplate: Generate email content
    EmailTemplate->>EmailClient: Return email content
    EmailClient->>User: Send email
Loading

🐰 "Oh, what a delight, changes abound,
In emails so bright, new layouts are found.
With headings that cheer and logos that shine,
A hop and a skip, everything's fine!
So let’s celebrate, with a joyful dance,
For emails now sing, giving users a chance!" 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@lukevella lukevella changed the title Email templates 💄 Updated transactional email templates Aug 29, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bdc1c6d and 9ebb3fd.

Files selected for processing (13)
  • apps/web/src/utils/emails.ts (2 hunks)
  • packages/emails/src/templates/_components/email-context.tsx (1 hunks)
  • packages/emails/src/templates/_components/email-layout.tsx (1 hunks)
  • packages/emails/src/templates/_components/notification-email.tsx (3 hunks)
  • packages/emails/src/templates/_components/styled-components.tsx (5 hunks)
  • packages/emails/src/templates/finalized-host.tsx (3 hunks)
  • packages/emails/src/templates/finalized-participant.tsx (3 hunks)
  • packages/emails/src/templates/login.tsx (2 hunks)
  • packages/emails/src/templates/new-comment.tsx (2 hunks)
  • packages/emails/src/templates/new-participant-confirmation.tsx (2 hunks)
  • packages/emails/src/templates/new-participant.tsx (2 hunks)
  • packages/emails/src/templates/new-poll.tsx (2 hunks)
  • packages/emails/src/templates/register.tsx (2 hunks)
Additional comments not posted (33)
packages/emails/src/templates/_components/email-context.tsx (1)

8-8: LGTM! Verify the new URL.

The change to the logoUrl property improves accessibility and reliability. Ensure that the new URL is correct and accessible.

apps/web/src/utils/emails.ts (3)

3-3: LGTM!

The import of the env object centralizes environment variable management, improving code clarity and maintainability.


8-8: LGTM!

The change to the openPreviews property improves code clarity by explicitly referencing the NODE_ENV property.


21-23: LGTM!

The change to the logoUrl property introduces flexibility in handling logo URLs based on the hosting environment, improving adaptability.

packages/emails/src/templates/new-comment.tsx (2)

5-5: LGTM!

The addition of the Heading component enhances the component's structure.


28-28: LGTM!

The addition of the Heading component improves the visual hierarchy and clarity of the email content.

packages/emails/src/templates/new-participant.tsx (2)

5-5: LGTM!

The new imports Heading and Text are necessary for the new components used in the NewParticipantEmail component.


28-33: LGTM!

The changes improve the clarity and presentation of the email notification by emphasizing the new response and guiding the recipient on the next steps.

packages/emails/src/templates/_components/notification-email.tsx (2)

1-1: LGTM!

The new import Section from @react-email/section is necessary for the new Section component used in the NotificationEmail component.


28-38: LGTM!

The changes streamline the component's structure and improve the layout and readability of the notification email.

packages/emails/src/templates/new-poll.tsx (2)

3-9: LGTM!

The new imports Button, Card, Heading, Link, and Text are necessary for the new components used in the NewPollEmail component.


30-40: LGTM!

The changes improve the clarity and presentation of the email notification by emphasizing the readiness of the meeting poll and guiding the recipient on the next steps.

packages/emails/src/templates/_components/email-layout.tsx (4)

8-8: LGTM!

The import statement for the Section component is correct and necessary for the new usage in the file.


12-12: LGTM!

The import statement for styled-components is correct and necessary for the styling and components used in the file.


20-25: LGTM!

The changes to containerStyles enhance the visual layout of the email.


33-56: LGTM!

The changes to the EmailLayout component simplify the rendering logic and enhance the visual layout.

packages/emails/src/templates/new-participant-confirmation.tsx (2)

3-9: LGTM!

The import statement for the Heading component is correct and necessary for the new usage in the file.


37-45: LGTM!

The changes to the NewParticipantConfirmationEmail component improve the visual hierarchy and user experience.

packages/emails/src/templates/register.tsx (3)

1-2: LGTM!

The import statement for the Card component is correct and necessary for the new usage in the file.


23-50: LGTM!

The changes to the RegisterEmail component improve the visual hierarchy and user experience.


44-50: LGTM!

The addition of the Section component improves the semantic organization of the email layout.

packages/emails/src/templates/login.tsx (2)

1-1: LGTM!

The import statements are correct and necessary for the component.


27-55: LGTM!

The changes improve the user experience by providing clear instructions and a more focused approach to logging in. The removal of the name prop simplifies the component interface.

packages/emails/src/templates/finalized-host.tsx (2)

5-10: LGTM!

The import statements are correct and necessary for the component.


Line range hint 36-84: LGTM!

The changes improve the visual hierarchy and clarity of the email content. The removal of the recipientName prop simplifies the component interface.

packages/emails/src/templates/finalized-participant.tsx (2)

5-10: LGTM!

The import statements are correct and necessary for the component.


Line range hint 38-85: LGTM!

The changes improve the visual hierarchy and clarity of the email content. The removal of the recipientName prop simplifies the component interface.

packages/emails/src/templates/_components/styled-components.tsx (6)

14-15: LGTM!

The addition of lightTextColor and darkTextColor constants improves maintainability and readability by avoiding hardcoded values.


28-28: LGTM!

The update to the Text component's color logic enhances flexibility and maintainability by using the new lightTextColor and darkTextColor constants.


51-55: LGTM!

The addition of new CSS properties (boxSizing, display, width, maxWidth, and textAlign) to the Button component ensures that buttons are more responsive and visually consistent across different contexts.


72-79: LGTM!

The redefinition of the fontSize object to include sizes for headings improves organization and reuse.


84-84: Verify the impact on accessibility and SEO.

The change to the Heading component's default as prop from "h3" to "h1" alters the semantic structure of the headings rendered by this component. Ensure that this change does not negatively impact accessibility and SEO.


158-158: LGTM!

The addition of the primaryColor constant enhances consistent theming throughout the styled components.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9ebb3fd and ac27154.

Files selected for processing (3)
  • packages/emails/src/templates/finalized-host.tsx (4 hunks)
  • packages/emails/src/templates/finalized-participant.tsx (4 hunks)
  • packages/emails/src/templates/new-participant-confirmation.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/emails/src/templates/new-participant-confirmation.tsx
Files skipped from review as they are similar to previous changes (2)
  • packages/emails/src/templates/finalized-host.tsx
  • packages/emails/src/templates/finalized-participant.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ac27154 and 121a8fe.

Files selected for processing (4)
  • apps/web/src/env.ts (2 hunks)
  • apps/web/src/utils/emails.ts (1 hunks)
  • packages/emails/src/templates/_components/email-context.tsx (1 hunks)
  • packages/emails/src/templates/login.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • apps/web/src/utils/emails.ts
  • packages/emails/src/templates/_components/email-context.tsx
Additional comments not posted (10)
packages/emails/src/templates/login.tsx (7)

1-1: LGTM!

The import statements are correct and necessary for the component.


Line range hint 13-18: LGTM!

The LoginEmail component definition and props have been updated correctly.


27-27: LGTM!

The EmailLayout component usage is correct and includes the necessary context and preview message.


28-29: LGTM!

The Heading and Text components are used correctly and enhance the user experience.


30-45: LGTM!

The Card component and its contents are used correctly and emphasize the verification code.


46-50: LGTM!

The Section and Button components are used correctly and provide a clear call to action.


51-55: LGTM!

The final Text component is used correctly and provides necessary information to the user.

apps/web/src/env.ts (3)

52-57: LGTM!

The new environment variables for support and no-reply email addresses are correctly defined using the z library for validation.


99-101: LGTM!

The new environment variables are correctly assigned to their corresponding process environment variables.


Line range hint 1-101: LGTM!

The overall structure and validation of environment variables are consistent and well-organized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
packages/emails/src/templates/login.tsx (1)

27-55: Email template streamlined effectively.

The LoginEmail component has been effectively updated to focus on the verification code, enhancing clarity and user guidance. The use of styled components like Card and Text for emphasizing the code and its validity period is well-executed.

However, consider adding alt text for accessibility to any images or icons used within the email template to enhance accessibility.

packages/emails/src/templates/finalized-participant.tsx (1)

Line range hint 37-84: Email template enhanced effectively.

The FinalizeParticipantEmail component has been effectively updated to improve the visual hierarchy and testability of the email template. The use of the data-testid attribute aids in testing, and the structured layout enhances the presentation.

However, ensure that all links and buttons in the email template have appropriate security attributes such as rel="noopener noreferrer" to enhance security when opening links in new tabs.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 121a8fe and e2f84ef.

Files selected for processing (14)
  • apps/web/src/env.ts (2 hunks)
  • apps/web/src/utils/emails.ts (1 hunks)
  • packages/emails/src/templates/_components/email-context.tsx (1 hunks)
  • packages/emails/src/templates/_components/email-layout.tsx (1 hunks)
  • packages/emails/src/templates/_components/notification-email.tsx (3 hunks)
  • packages/emails/src/templates/_components/styled-components.tsx (5 hunks)
  • packages/emails/src/templates/finalized-host.tsx (4 hunks)
  • packages/emails/src/templates/finalized-participant.tsx (4 hunks)
  • packages/emails/src/templates/login.tsx (2 hunks)
  • packages/emails/src/templates/new-comment.tsx (2 hunks)
  • packages/emails/src/templates/new-participant-confirmation.tsx (2 hunks)
  • packages/emails/src/templates/new-participant.tsx (2 hunks)
  • packages/emails/src/templates/new-poll.tsx (2 hunks)
  • packages/emails/src/templates/register.tsx (2 hunks)
Files skipped from review due to trivial changes (2)
  • packages/emails/src/templates/new-comment.tsx
  • packages/emails/src/templates/new-participant-confirmation.tsx
Files skipped from review as they are similar to previous changes (9)
  • apps/web/src/env.ts
  • apps/web/src/utils/emails.ts
  • packages/emails/src/templates/_components/email-context.tsx
  • packages/emails/src/templates/_components/notification-email.tsx
  • packages/emails/src/templates/_components/styled-components.tsx
  • packages/emails/src/templates/finalized-host.tsx
  • packages/emails/src/templates/new-participant.tsx
  • packages/emails/src/templates/new-poll.tsx
  • packages/emails/src/templates/register.tsx
Additional comments not posted (5)
packages/emails/src/templates/_components/email-layout.tsx (4)

8-8: Approved: Import and usage of Section.

The addition of the Section component aligns with the changes in the component's structure.


20-25: Approved: Style adjustments in containerStyles.

The changes to maxWidth, background, padding, and color enhance the visual layout of the email.


38-56: Approved: Visual enhancements to Img and addition of footer Section.

The changes to the Img component and the addition of a new Section for the footer text align with the goal of a more minimalistic and visually appealing email layout.


12-12: Verify: Impact of changes to EmailLayoutProps.

The removal of recipientName and footNote simplifies the interface but ensure all usages of EmailLayout have been updated to reflect these changes.

Verification successful

Verification Successful: No issues found with EmailLayoutProps changes.

The removal of recipientName and footNote from EmailLayoutProps has been correctly reflected across the codebase. No instances of these props are being used in the current usages of EmailLayout.

  • Files checked include new-participant-confirmation.tsx, new-poll.tsx, register.tsx, finalized-participant.tsx, finalized-host.tsx, notification-email.tsx, and login.tsx.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `EmailLayout` to ensure they do not pass `recipientName` or `footNote`.

# Test: Search for the function usage. Expect: No occurrences of the removed props.
rg --type typescript -A 5 $'EmailLayout'

Length of output: 74


Script:

#!/bin/bash
# Description: Verify all usages of `EmailLayout` to ensure they do not pass `recipientName` or `footNote`.

# Test: Search for the function usage without specifying a file type.
rg -A 5 'EmailLayout'

Length of output: 10302

packages/emails/src/templates/login.tsx (1)

1-2: Interface and imports updated successfully.

The updated LoginEmailProps interface correctly reflects the new properties used in the email template, aligning with the PR's objectives to simplify and enhance the email configuration.

Also applies to: 10-14

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e2f84ef and 3ac0765.

Files ignored due to path filters (1)
  • apps/web/public/images/rallly-logo-mark.png is excluded by !**/*.png
Files selected for processing (1)
  • apps/web/src/utils/emails.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/utils/emails.ts

@lukevella lukevella merged commit 2f00dac into main Aug 30, 2024
7 checks passed
@lukevella lukevella deleted the email-templates branch August 30, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant