Skip to content

Change reply-to on emails #8449

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Change reply-to on emails #8449

wants to merge 7 commits into from

Conversation

normanrz
Copy link
Member

Change reply-to in emails to be more useful

@normanrz normanrz requested a review from fm3 March 17, 2025 10:02
Copy link
Contributor

coderabbitai bot commented Mar 17, 2025

📝 Walkthrough

Walkthrough

This pull request modifies the email functionality in several files. In DefaultMails.scala, the email methods now utilize a dynamic supportEmail instead of a static address, alongside new ccRecipients and replyTo lists. The Mail.scala file updates the replyTo field to support multiple addresses. A new supportEmail configuration entry is added to application.conf, and various email templates are updated to include an organizationName parameter, enhancing personalization in communications.

Changes

File(s) Change Summary
app/mail/DefaultMails.scala Updated multiple email methods to use supportEmail, added ccRecipients and replyTo lists, and modified signatures to include organizationName.
app/mail/Mail.scala Changed the replyTo field type in the Mail case class from Option[String] to List[String] for multiple reply-to addresses.
conf/application.conf Added new configuration entry: supportEmail = "Support <[email protected]>" in the mail section for user support inquiries.
app/controllers/OrganizationController.scala Simplified email sending logic by consolidating parameters and removing separate upgrade request emails; updated method signatures accordingly.
app/utils/WkConf.scala Introduced a new configuration parameter supportEmail to retrieve the support email from the configuration.
app/views/mail/*.scala.html Updated multiple email templates to include organizationName parameter and revised email body content for clarity and personalization.
frontend/javascripts/admin/organization/pricing_plan_utils.ts Modified description in powerPlanFeatures from "Unlimited Users" to "Up to Unlimited Users."
app/views/mail/upgradePricingPlanRequest.scala.html Removed the email template for upgrade requests, eliminating related functionality.

Possibly related PRs

  • Make email footer line configurable #8326: Updates to the helpMail and upgradePricingPlanRequestMail methods in DefaultMails.scala with additional footer management, which shares code-level similarities with this PR.

Suggested labels

backend, new feature

Poem

I'm a rabbit with hops so fair,
Coding emails with tender care.
CCs and replies now multiply,
Static addresses and lists fly high!
Carrots and code, together we share.
🥕🐇 Happy changes, everywhere!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 generate docstrings to generate docstrings for this 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
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

LGTM. Did you have a way to test it?

recipients = List("[email protected]", userEmail)
recipients = List("[email protected]"),
ccRecipients = List(userEmail),
replyTo = List(userEmail, "[email protected]")
Copy link
Member

Choose a reason for hiding this comment

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

@normanrz Shouldn't this be webknossos-support A T scalableminds.com?

@normanrz normanrz requested a review from fm3 March 19, 2025 08:56
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

🧹 Nitpick comments (5)
frontend/javascripts/admin/organization/pricing_plan_utils.ts (1)

22-22: Consider rephrasing "Up to Unlimited Users"

The phrase "Up to Unlimited Users" is logically confusing as "unlimited" already implies no upper bound. Consider alternative phrasing such as "Unlimited Users Available" or simply "Unlimited Users" if that's what the plan offers.

-  "Up to Unlimited Users",
+  "Unlimited Users Available",
app/views/mail/upgradePricingPlanStorage.scala.html (1)

5-5: Fix grammatical error in thank you message

There's a missing word in the thank you message.

-<p>Thank you for interest in adding more storage to your WEBKNOSSOS plan. Our sales team will contact you shortly.</p>
+<p>Thank you for your interest in adding more storage to your WEBKNOSSOS plan. Our sales team will contact you shortly.</p>
app/views/mail/upgradePricingPlanUsers.scala.html (1)

5-5: There appears to be a typo in the message.

The phrase "Thank you for interest in..." is missing the word "your" which makes the sentence grammatically incorrect.

-<p>Thank you for interest in adding more users to your WEBKNOSSOS plan. Our sales team will contact you shortly.</p>
+<p>Thank you for your interest in adding more users to your WEBKNOSSOS plan. Our sales team will contact you shortly.</p>
app/views/mail/upgradePricingPlanToPower.scala.html (1)

1-1: Parameter addition looks good, but there's an inconsistent space.

The parameter declaration has an extra space after the opening parenthesis that isn't present in other templates.

-@( name: String, additionalFooter: String, organizationName: String)
+@(name: String, additionalFooter: String, organizationName: String)
app/mail/DefaultMails.scala (1)

142-144: Verify the order of email addresses in the reply-to field.

I notice that across all the upgrade emails, the order is replyTo = List(userEmail, supportEmail) which is different from the help email that uses replyTo = List(supportEmail, userEmail). While this likely doesn't affect functionality, consider whether there should be a consistent ordering.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 966b273 and 58e6fd0.

📒 Files selected for processing (10)
  • app/controllers/OrganizationController.scala (4 hunks)
  • app/mail/DefaultMails.scala (2 hunks)
  • app/utils/WkConf.scala (1 hunks)
  • app/views/mail/extendPricingPlan.scala.html (1 hunks)
  • app/views/mail/upgradePricingPlanRequest.scala.html (0 hunks)
  • app/views/mail/upgradePricingPlanStorage.scala.html (1 hunks)
  • app/views/mail/upgradePricingPlanToPower.scala.html (1 hunks)
  • app/views/mail/upgradePricingPlanToTeam.scala.html (1 hunks)
  • app/views/mail/upgradePricingPlanUsers.scala.html (1 hunks)
  • frontend/javascripts/admin/organization/pricing_plan_utils.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • app/views/mail/upgradePricingPlanRequest.scala.html
🧰 Additional context used
🧬 Code Definitions (2)
app/controllers/OrganizationController.scala (1)
app/mail/DefaultMails.scala (3) (3)
  • extendPricingPlanMail (107-117)
  • upgradePricingPlanUsersMail (137-147)
  • upgradePricingPlanStorageMail (147-161)
app/mail/DefaultMails.scala (2)
app/mail/Mail.scala (1) (1)
  • Mail (3-13)
app/utils/WkConf.scala (2) (2)
  • Mail (159-183)
  • additionalFooter (173-173)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: circleci_build
🔇 Additional comments (18)
app/utils/WkConf.scala (1)

171-171: Adding support email configuration looks good.

This addition allows for a configurable support email address which is a good practice instead of hardcoding it, aligning with the overall configuration pattern used in this file.

app/views/mail/extendPricingPlan.scala.html (2)

1-1: LGTM: Parameter added for organization name

Adding the organization name parameter enhances email personalization.


5-6: Email text improvements look good

The updated message is more concise and professional. Including the organization name provides better context for the support team.

app/views/mail/upgradePricingPlanStorage.scala.html (2)

1-1: LGTM: Parameter added for organization name

Adding the organization name parameter enhances email personalization.


7-7: LGTM: Organization name display added

Adding the organization name to the email provides better context for the support team.

app/views/mail/upgradePricingPlanToTeam.scala.html (2)

1-1: Parameter addition looks good.

The addition of organizationName parameter aligns with the PR objective to enhance email functionality. This allows for better personalization of emails.


5-6: Improved message clarity and added organization context.

Good changes:

  1. The updated message has a more conversational tone, focusing on the customer's "interest" rather than a "request"
  2. Adding the organization name provides important context for both the recipient and the support team

These changes will make email communication more effective.

app/views/mail/upgradePricingPlanUsers.scala.html (2)

1-1: Parameter addition looks good.

Adding the organizationName parameter matches the changes in other email templates, ensuring consistency across the codebase.


7-7: Organization information addition looks good.

Adding the organization name to the email body is consistent with other templates and provides important context.

app/views/mail/upgradePricingPlanToPower.scala.html (1)

5-6: Improved message clarity and added organization context.

The updated message and addition of the organization name are consistent with other templates and provide better context for both the recipient and the support team.

app/controllers/OrganizationController.scala (4)

194-194: Email sending now includes organization name.

The update correctly passes the organization name to the email template, aligning with changes in the DefaultMails class.


211-211: Simplified mail function call with organization name.

The code now effectively passes the organization name to the appropriate mail function based on the requested plan.


222-222: Email for additional users now includes organization name.

The update correctly passes the organization name to the email template for upgrades related to additional users.


233-233: Email for additional storage now includes organization name.

The update correctly passes the organization name to the email template for upgrades related to additional storage.

app/mail/DefaultMails.scala (4)

16-16: Good addition of the supportEmail configuration.

This change enables dynamic configuration of the support email address through the application configuration file, which promotes flexibility and maintainability.


102-104: Well-structured email routing for help requests.

The new email structure ensures support requests are properly routed:

  1. Primary recipient is the support email
  2. User is CCed to maintain visibility
  3. Reply-to includes both addresses to facilitate multi-party conversation

This improves the support workflow by keeping all relevant parties in the communication loop.


107-115: Improved email configuration for pricing plan extension.

The changes enhance the email functionality by:

  1. Adding organization name personalization to the email template
  2. Directing the primary email to the user instead of support
  3. CCing support for visibility
  4. Setting up replies to reach both parties

Consider whether the support email should be using the suggested format mentioned in the previous review.

What is the best practice for support email address formats for SaaS products?

117-125: Consistent implementation across all upgrade email methods.

The changes maintain a consistent pattern across all upgrade notification emails:

  1. Adding organization name parameter for personalization
  2. User as primary recipient with support CCed
  3. Reply-to configuration that includes both addresses

This consistency is excellent for maintainability and user experience.

Also applies to: 127-135, 137-145, 147-159

@fm3
Copy link
Member

fm3 commented Apr 2, 2025

@normanrz I think you said this didn’t work for you as expected, right? Is there a smaller subset of this PR that we should merge anyway? Or should we close this?

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.

3 participants