Skip to content

chore: add new email tempalte#1543

Open
qinluhe wants to merge 2 commits intomainfrom
chore/add-new-email-template
Open

chore: add new email tempalte#1543
qinluhe wants to merge 2 commits intomainfrom
chore/add-new-email-template

Conversation

@qinluhe
Copy link
Contributor

@qinluhe qinluhe commented Aug 5, 2025

Summary by Sourcery

New Features:

  • Add HTML email template for mention notifications with avatar support, header, preheader, CTA button, and social links in the footer

@sourcery-ai
Copy link

sourcery-ai bot commented Aug 5, 2025

Reviewer's Guide

Adds a complete HTML email template for user mention notifications, utilizing front-matter metadata, dynamic placeholders, a responsive table-based layout with inline styling, a CTA button, and a social media-enabled footer.

File-Level Changes

Change Details Files
Introduce email template for user mention notifications
  • Add front-matter metadata (title, preheader, bodyClass)
  • Embed hidden preview text and dynamic placeholders (userName, contentName, timestamp, contentPath, actionUrl)
  • Construct responsive table layout with inline CSS and logo header
  • Implement styled CTA button and social media footer with support link
email_template/src/templates/notification_template_with_avatar.html

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @qinluhe - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `email_template/src/templates/notification_template_with_avatar.html:36` </location>
<code_context>
+        >
+          <tr>
+            <td align="center" style="padding-bottom: 24px">
+              <img
+                src="{{ cdnBaseUrl }}images/appflowy.png"
+                width="64"
+                height="64"
</code_context>

<issue_to_address>
The avatar image is hardcoded and does not use a user-specific avatar.

Consider replacing the static image source with a dynamic variable like {{ userAvatarUrl }} to display the correct user's avatar.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
                src="{{ cdnBaseUrl }}images/appflowy.png"
=======
                src="{{ userAvatarUrl }}"
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `email_template/src/templates/notification_template_with_avatar.html:183` </location>
<code_context>
+                  />
+                </a>
+                <a
+                  href="https://x.com/appflowy"
+                  style="
+text-decoration: none;
+                    display: inline-block;
+                    margin: 0 10px 0 0;
+                  "
+                >
+                  <img
+                    src="{{ cdnBaseUrl }}images/twitter.png"
+                    width="20"
+                    height="20"
</code_context>

<issue_to_address>
The icon for X (formerly Twitter) uses a 'twitter.png' image.

Consider updating the icon to match X's current branding to avoid confusion.

Suggested implementation:

```
                  <img
                    src="{{ cdnBaseUrl }}images/x.png"
                    width="20"
                    height="20"

```

```
                    src="{{ cdnBaseUrl }}images/x.png"
                    width="20"
                    height="20"

```

```
                    height="20"
                    alt="X"

```

Make sure to add the new `x.png` icon to your CDN at the path `images/x.png` to ensure the image loads correctly.
</issue_to_address>

### Comment 3
<location> `email_template/src/templates/notification_template_with_avatar.html:24` </location>
<code_context>
+      color: #000000;
+    "
+  >
+    <tr>
+      <td align="center" valign="top">
+        <table
+          width="600"
</code_context>

<issue_to_address>
The outer table uses a fixed width of 600px, which may not be mobile-friendly.

Consider using width: 100% with a max-width to enhance mobile compatibility and prevent rendering issues on smaller screens.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
        <table
          width="600"
          border="0"
          cellpadding="0"
          cellspacing="0"
          bgcolor="#ffffff"
          style="border-radius: 12px; padding: 32px; margin: 0 auto"
        >
=======
        <table
          width="100%"
          border="0"
          cellpadding="0"
          cellspacing="0"
          bgcolor="#ffffff"
          style="border-radius: 12px; padding: 32px; margin: 0 auto; max-width: 600px;"
        >
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

<tr>
<td align="center" style="padding-bottom: 24px">
<img
src="{{ cdnBaseUrl }}images/appflowy.png"
Copy link

Choose a reason for hiding this comment

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

suggestion: The avatar image is hardcoded and does not use a user-specific avatar.

Consider replacing the static image source with a dynamic variable like {{ userAvatarUrl }} to display the correct user's avatar.

Suggested change
src="{{ cdnBaseUrl }}images/appflowy.png"
src="{{ userAvatarUrl }}"

Comment on lines +183 to +191
href="https://x.com/appflowy"
style="
text-decoration: none;
display: inline-block;
margin: 0 10px 0 0;
"
>
<img
src="{{ cdnBaseUrl }}images/twitter.png"
Copy link

Choose a reason for hiding this comment

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

suggestion: The icon for X (formerly Twitter) uses a 'twitter.png' image.

Consider updating the icon to match X's current branding to avoid confusion.

Suggested implementation:

                  <img
                    src="{{ cdnBaseUrl }}images/x.png"
                    width="20"
                    height="20"

                    src="{{ cdnBaseUrl }}images/x.png"
                    width="20"
                    height="20"

                    height="20"
                    alt="X"

Make sure to add the new x.png icon to your CDN at the path images/x.png to ensure the image loads correctly.

Comment on lines +26 to +33
<table
width="600"
border="0"
cellpadding="0"
cellspacing="0"
bgcolor="#ffffff"
style="border-radius: 12px; padding: 32px; margin: 0 auto"
>
Copy link

Choose a reason for hiding this comment

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

suggestion: The outer table uses a fixed width of 600px, which may not be mobile-friendly.

Consider using width: 100% with a max-width to enhance mobile compatibility and prevent rendering issues on smaller screens.

Suggested change
<table
width="600"
border="0"
cellpadding="0"
cellspacing="0"
bgcolor="#ffffff"
style="border-radius: 12px; padding: 32px; margin: 0 auto"
>
<table
width="100%"
border="0"
cellpadding="0"
cellspacing="0"
bgcolor="#ffffff"
style="border-radius: 12px; padding: 32px; margin: 0 auto; max-width: 600px;"
>

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