-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[WEB-4063]chore: updated work item email template #7044
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
base: preview
Are you sure you want to change the base?
Conversation
WalkthroughThe changes introduce a new context variable, Changes
Sequence Diagram(s)sequenceDiagram
participant Task as EmailNotificationTask
participant Template as EmailTemplate
Task->>Template: Render issue-updates.html with context { entity_type: "issue", ... }
Template-->>Task: Returns rendered email with dynamic entity_type
Suggested labels
Suggested reviewers
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
There was a problem hiding this 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 (2)
apiserver/plane/bgtasks/email_notification_task.py (1)
287-288
: Consider parameterizingentity_type
for flexibility
Currentlyentity_type
is hardcoded to"issue"
. If you plan to reuse this task for other entity types, refactor the task signature to acceptentity_type
as an argument instead of a literal.A minimal diff:
@@ -171,7 +171,8 @@ @shared_task -def send_email_notification( - issue_id, notification_data, receiver_id, email_notification_ids +def send_email_notification( + issue_id, notification_data, receiver_id, email_notification_ids, entity_type="issue" ): # ... context = { @@ -286,7 +287,7 @@ def send_email_notification( "comments": comments, - "entity_type": "issue", + "entity_type": entity_type, } html_content = render_to_string( "emails/notifications/issue-updates.html", contextYou'll also need to update the call sites (e.g.
send_email_notification.delay(...)
) to pass the newentity_type
parameter.apiserver/templates/emails/notifications/issue-updates.html (1)
235-235
: Refine unsubscribe wording
Nitpick: consider changing “unsubscribe to” to “unsubscribe from” and clarify what notifications are being unsubscribed.Proposed diff:
- This email was sent to <a href="mailto:{{receiver.email}}">{{ receiver.email }}</a>. If you'd rather not receive this kind of email, <a href="{{ issue_url }}">you can unsubscribe to the {{entity_type}}</a> or <a href="{{ user_preference }}">manage your email preferences</a>. + This email was sent to <a href="mailto:{{receiver.email}}">{{ receiver.email }}</a>. If you'd rather not receive these {{entity_type}} notifications, <a href="{{ issue_url }}">you can unsubscribe from them</a> or <a href="{{ user_preference }}">manage your email preferences</a>.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apiserver/plane/bgtasks/email_notification_task.py
(1 hunks)apiserver/templates/emails/notifications/issue-updates.html
(3 hunks)
🔇 Additional comments (3)
apiserver/templates/emails/notifications/issue-updates.html (3)
6-6
: Dynamic title placeholder approved
Replacing the hardcoded title with{{entity_type}}
properly generalizes the email subject for different entities.
40-40
: Generalized update message
Using{{entity_type}}
instead of the literal"issue"
correctly parameterizes the “title has been updated” message.
227-227
: Call-to-action text generalized
The CTA now dynamically displays the entity type (“View {{entity_type}}”), making the template reusable for other entity notifications.
Description
Updated email template to accept entity dynamically.
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
WEB-4063
Summary by CodeRabbit
New Features
Style