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

Email: Small fixes for best practice #965

Merged
merged 5 commits into from
Dec 2, 2024
Merged

Conversation

ssandino
Copy link
Member

@ssandino ssandino commented Dec 2, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced accessibility by adding language attributes to HTML tags across various email templates.
    • Introduction of localized content in multiple languages (German, English, French, Italian) for welcome and payout emails.
  • Content Updates

    • Streamlined newsletter content by removing internal updates and focusing on broader themes.
    • Updated titles and greetings in emails to reflect the recipient's language and enhance personalization.
  • Structural Improvements

    • Improved HTML structure for emails to ensure consistent rendering across different email clients.
    • Retained overall layout while enhancing clarity and effectiveness of messaging.

Copy link

vercel bot commented Dec 2, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
public ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 1:55pm

Copy link

coderabbitai bot commented Dec 2, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request includes updates to multiple HTML email templates, primarily enhancing accessibility by adding a lang attribute to the <html> tag across various newsletters and transactional emails. Additionally, some newsletters have undergone content modifications, including the removal or replacement of specific sections, while maintaining the overall structure and styling. The changes aim to ensure that the emails are better localized for their respective audiences.

Changes

File Path Change Summary
shared/emails/newsletter/2024-05-newsletter.html Updated <html> tag from xmlns="http://www.w3.org/1999/html" to lang="en" for accessibility.
shared/emails/newsletter/2024-06-newsletter.html Updated <html> tag to lang="en"; removed "team news" section.
shared/emails/newsletter/2024-07-newsletter.html Updated <html> tag to lang="en"; no content changes.
shared/emails/newsletter/2024-08-newsletter.html Updated <html> tag to lang="en"; structured content maintained.
shared/emails/newsletter/2024-09-newsletter.html Updated <html> tag to lang="en"; content updated with new information.
shared/emails/newsletter/2024-10-newsletter.html Complete overhaul with new HTML structure and styles added.
shared/emails/newsletter/2024-11-newsletter.html Updated <html> tag to lang="en"; replaced "Volunteer News" with "Randomness, Doubts and War."
shared/emails/transactional/payout-email-de.html Updated <html> tag to lang="de" for German localization.
shared/emails/transactional/payout-email-en.html Updated <html> tag to lang="en" for English localization.
shared/emails/transactional/payout-email-fr.html Updated <html> tag to lang="fr" for French localization.
shared/emails/transactional/payout-email-it.html Updated <html> tag to lang="it" for Italian localization.
shared/emails/transactional/welcome-1-de.html Updated <html> tag to lang="de"; localized content for German audience.
shared/emails/transactional/welcome-1-en.html Updated <html> tag to lang="en"; minor adjustments in content.
shared/emails/transactional/welcome-1-fr.html Updated <html> tag to lang="fr"; localized content for French audience.
shared/emails/transactional/welcome-1-it.html Updated <html> tag to lang="it"; localized content for Italian audience.
shared/emails/transactional/welcome-2-de.html Updated <html> tag to lang="de"; localized title and content.
shared/emails/transactional/welcome-2-en.html Updated <html> tag to lang="en"; structure and content maintained.
shared/emails/transactional/welcome-2-fr.html Updated <html> tag to lang="it"; localized title and content.
shared/emails/transactional/welcome-3-de.html Updated <html> tag to lang="de"; localized content for German audience.
shared/emails/transactional/welcome-3-en.html Updated <html> tag to lang="en"; structure and content maintained.
shared/emails/transactional/welcome-3-fr.html Updated <html> tag to lang="fr"; localized content for French audience.
shared/emails/transactional/welcome-3-it.html Updated <html> tag to lang="it"; localized content for Italian audience.
shared/emails/transactional/welcome-4-de.html Updated <html> tag to lang="de"; localized title and content.
shared/emails/transactional/welcome-4-en.html Updated <html> tag to lang="en"; structure and content maintained.
shared/emails/transactional/welcome-4-fr.html Updated <html> tag to lang="fr"; localized content for French audience.
shared/emails/transactional/welcome-4-it.html Updated <html> tag to lang="it"; localized content for Italian audience.

Possibly related PRs

  • Email: November 2024 Newsletter  #957: The changes in the November 2024 newsletter PR involve updating the HTML structure to include a language attribute in the <html> tag, similar to the changes made in the main PR, which also focuses on enhancing accessibility by specifying the language in the HTML tag.

Suggested reviewers

  • mkue
  • socialincome-dev

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 373343c and 8ec0cbf.

📒 Files selected for processing (2)
  • shared/emails/transactional/welcome-2-fr.html (1 hunks)
  • shared/emails/transactional/welcome-2-it.html (1 hunks)
🔇 Additional comments (3)
shared/emails/transactional/welcome-2-it.html (1)

1-2: LGTM!

The HTML lang attribute correctly matches the Italian content.

shared/emails/transactional/welcome-2-fr.html (2)

1-2: Language attribute now correctly matches content

The HTML lang attribute is properly set to "fr" for French content, addressing the previous review comment.


Line range hint 1-600: Good accessibility practices

The template follows accessibility best practices:

  • Proper alt text for images
  • Semantic HTML structure
  • Sufficient color contrast
  • Proper link attributes

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.

Copy link

github-actions bot commented Dec 2, 2024

Visit the preview URL for this PR (updated for commit 8ec0cbf):

https://si-admin-staging--pr965-sandino-email-best-p-1tjmarvt.web.app

(expires Mon, 09 Dec 2024 13:59:29 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: b7b0969384059dce6ea8fad1ee1d1737e54e6676

Copy link

@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: 1

🧹 Outside diff range and nitpick comments (9)
shared/emails/transactional/welcome-2-de.html (1)

Line range hint 250-251: Add localized alt text for images

The image alt attributes should be localized to German for better accessibility.

-alt="Logo"
+alt="Logo Social Income"
-alt=""
+alt="Illustration zur Armutsbekämpfung"

Also applies to: 261-262

shared/emails/transactional/welcome-2-fr.html (1)

Line range hint 250-251: Add localized alt text for images

The image alt attributes should be localized to French for better accessibility.

-alt="Logo"
+alt="Logo Social Income"
-alt=""
+alt="Illustration sur la lutte contre la pauvreté"

Also applies to: 261-262

shared/emails/transactional/welcome-4-it.html (1)

Line range hint 48-56: Fix inconsistent width attributes in logo image

The logo image has conflicting width values:

  • HTML width attribute: width="48"
  • Inline style: width: 250px

Apply this fix:

 <img
     src="http://cdn.mcauto-images-production.sendgrid.net/044784a789c4863a/b641e150-9ec7-4220-b6a3-2616e65915ac/935x101.png"
     alt="Logo"
-    width="48"
+    width="250"
     style="display: block; width: 250px; max-width: 250px; min-width: 250px"
 />
shared/emails/transactional/welcome-1-fr.html (1)

Line range hint 48-48: Add French alt text for images.

Image alt texts should be localized to French for better accessibility.

Apply this change to the image elements:

-alt="Logo"
+alt="Logo Social Income"
-alt="Portrait Aurélie"
+alt="Portrait d'Aurélie"
-alt="Signature"
+alt="Signature d'Aurélie"

Also applies to: 122-122, 209-209

shared/emails/transactional/welcome-3-it.html (1)

Line range hint 48-48: Fix inconsistent image width attributes.

The logo image has mismatched width attributes:

  • width="48" in the HTML attribute
  • width: 250px in the style attribute

Apply this fix:

-width="48"
+width="250"
shared/emails/newsletter/2024-09-newsletter.html (4)

2-2: Good addition of the lang attribute for accessibility!

The addition of the lang="en" attribute improves screen reader support and browser language detection.

Consider adding aria-label attributes to interactive elements and alt text to all images for better accessibility.


Line range hint 8-117: Consider additional email client compatibility improvements

While the template includes good email client compatibility practices, consider these additional improvements:

  • Add MSO line-height fixes for Outlook
  • Include WebKit-specific media queries for better iOS rendering
 <style type="text/css">
+    /* MSO line-height fix */
+    * {
+        mso-line-height-rule: exactly;
+    }
+    
+    /* iOS webkit fix */
+    @media screen and (-webkit-min-device-pixel-ratio:0) {
+        .body {
+            margin: 0 !important;
+        }
+    }

Line range hint 8-67: Optimize repeated styles using CSS classes

Several inline styles are repeated throughout the template. Consider extracting common styles into CSS classes to improve maintainability.

 <style type="text/css">
+    .text-primary {
+        font-family: 'Unica77', Helvetica, Arial, sans-serif;
+        font-weight: 400;
+        font-size: 22px;
+        line-height: 30px;
+        color: #191a19;
+    }

Line range hint 571-579: Good security practices for external links!

The consistent use of target="_blank" with rel="noopener noreferrer" prevents potential security vulnerabilities.

Consider adding UTM parameters to external links for better tracking of newsletter engagement.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f44bd82 and 373343c.

📒 Files selected for processing (26)
  • shared/emails/newsletter/2024-05-newsletter.html (1 hunks)
  • shared/emails/newsletter/2024-06-newsletter.html (1 hunks)
  • shared/emails/newsletter/2024-07-newsletter.html (1 hunks)
  • shared/emails/newsletter/2024-08-newsletter.html (1 hunks)
  • shared/emails/newsletter/2024-09-newsletter.html (1 hunks)
  • shared/emails/newsletter/2024-10-newsletter.html (1 hunks)
  • shared/emails/newsletter/2024-11-newsletter.html (0 hunks)
  • shared/emails/transactional/payout-email-de.html (1 hunks)
  • shared/emails/transactional/payout-email-en.html (1 hunks)
  • shared/emails/transactional/payout-email-fr.html (1 hunks)
  • shared/emails/transactional/payout-email-it.html (1 hunks)
  • shared/emails/transactional/welcome-1-de.html (1 hunks)
  • shared/emails/transactional/welcome-1-en.html (1 hunks)
  • shared/emails/transactional/welcome-1-fr.html (1 hunks)
  • shared/emails/transactional/welcome-1-it.html (1 hunks)
  • shared/emails/transactional/welcome-2-de.html (1 hunks)
  • shared/emails/transactional/welcome-2-en.html (1 hunks)
  • shared/emails/transactional/welcome-2-fr.html (1 hunks)
  • shared/emails/transactional/welcome-3-de.html (1 hunks)
  • shared/emails/transactional/welcome-3-en.html (1 hunks)
  • shared/emails/transactional/welcome-3-fr.html (1 hunks)
  • shared/emails/transactional/welcome-3-it.html (1 hunks)
  • shared/emails/transactional/welcome-4-de.html (1 hunks)
  • shared/emails/transactional/welcome-4-en.html (1 hunks)
  • shared/emails/transactional/welcome-4-fr.html (1 hunks)
  • shared/emails/transactional/welcome-4-it.html (1 hunks)
💤 Files with no reviewable changes (1)
  • shared/emails/newsletter/2024-11-newsletter.html
✅ Files skipped from review due to trivial changes (9)
  • shared/emails/transactional/payout-email-it.html
  • shared/emails/transactional/payout-email-en.html
  • shared/emails/transactional/payout-email-de.html
  • shared/emails/newsletter/2024-07-newsletter.html
  • shared/emails/transactional/welcome-3-en.html
  • shared/emails/newsletter/2024-08-newsletter.html
  • shared/emails/newsletter/2024-05-newsletter.html
  • shared/emails/transactional/welcome-2-en.html
  • shared/emails/transactional/payout-email-fr.html
👮 Files not reviewed due to content moderation or server errors (3)
  • shared/emails/transactional/welcome-3-fr.html
  • shared/emails/newsletter/2024-06-newsletter.html
  • shared/emails/newsletter/2024-10-newsletter.html
🔇 Additional comments (11)
shared/emails/transactional/welcome-2-de.html (1)

1-2: LGTM: Proper language attribute set

The HTML lang attribute is correctly set to "de" for German content.

shared/emails/transactional/welcome-4-de.html (1)

1-2: LGTM: Proper language attribute set

The HTML lang attribute is correctly set to "de" for German content.

shared/emails/transactional/welcome-1-de.html (1)

2-2: LGTM: Proper language declaration added

The addition of lang="de" attribute correctly identifies German content, improving accessibility for screen readers and search engines.

shared/emails/transactional/welcome-4-en.html (1)

2-2: LGTM: Proper language declaration added

The addition of lang="en" attribute correctly identifies English content, improving accessibility.

shared/emails/transactional/welcome-4-it.html (1)

2-2: LGTM: Proper language declaration added

The addition of lang="it" attribute correctly identifies Italian content, improving accessibility.

shared/emails/transactional/welcome-4-fr.html (1)

2-2: LGTM: Proper language attribute added

The lang="fr" attribute correctly specifies French as the document language, improving accessibility.

shared/emails/transactional/welcome-1-it.html (1)

2-2: LGTM: Proper language attribute added

The lang="it" attribute correctly specifies Italian as the document language, improving accessibility.

shared/emails/transactional/welcome-1-en.html (1)

2-2: LGTM: Proper language attribute added

The lang="en" attribute correctly specifies English as the document language, improving accessibility.

shared/emails/transactional/welcome-1-fr.html (1)

2-2: LGTM! Language attribute correctly set.

The lang="fr" attribute properly indicates French content, improving accessibility and SEO.

shared/emails/transactional/welcome-3-de.html (1)

2-2: LGTM! Language attribute correctly set.

The lang="de" attribute properly indicates German content, improving accessibility and SEO.

shared/emails/transactional/welcome-3-it.html (1)

2-2: LGTM! Language attribute correctly set.

The lang="it" attribute properly indicates Italian content, improving accessibility and SEO.

Comment on lines 1 to 2
<!doctype html>
<html xmlns="http://www.w3.org/1999/html">
<html lang="it">
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix language attribute mismatch

The HTML lang attribute is set to "it" (Italian) but the content is in French. This affects accessibility tools and search engines.

-<html lang="it">
+<html lang="fr">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<!doctype html>
<html xmlns="http://www.w3.org/1999/html">
<html lang="it">
<!doctype html>
<html lang="fr">

@ssandino ssandino merged commit c0b90fc into main Dec 2, 2024
19 checks passed
@ssandino ssandino deleted the sandino/email-best-practice branch December 2, 2024 14:09
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.

2 participants