Loading
Add Internal note indicator to email notifications
What does this MR do and why?
Add a visible 'Internal note' indicator to email notifications triggered by internal notes (note.internal? == true). Previously, internal notes sent via email looked identical to public comments, causing confusion about visibility and concern that confidential information is being leaked when the comments are internal only.
- HTML email: renders a styled amber badge (
🔒 Internal note) above the author line, using inline styles for email client compatibility - Plain-text email: prepends
[Internal note]on its own line before the note body - Mailer preview: adds
note_issue_email_for_internal_notepreview toNotifyPreview - Specs: covers HTML and plain-text variants for internal notes, plus regression guard for public comments
Part of #487396
References
- Closes #606746 (closed)
- Parent issue: #487396
Screenshots or screen recordings
| Before | After |
|---|---|
| Internal note email looks identical to public comment | Email shows amber 'Internal note' badge above author line |
How to set up and validate locally
- In rails console, create an internal note on an issue:
project = Project.first user = User.first issue = project.issues.first note = Notes::CreateService.new(project, user, noteable_type: 'Issue', noteable_id: issue.id, note: 'This is internal', internal: true).execute Notify.note_issue_email(user.id, note.id).deliver_now - Check the email in your mail catcher — it should show the amber 'Internal note' badge
- Run
bundle exec rspec spec/mailers/notify_spec.rb -e 'internal'to verify specs pass
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Tim Poffenbarger