Skip to content

Update email notification template to include course details and pending request list - #544

Merged
cycomachead merged 1 commit into
mainfrom
cycomachead/224-update-email-notification-template/1
Aug 6, 2026
Merged

Update email notification template to include course details and pending request list#544
cycomachead merged 1 commit into
mainfrom
cycomachead/224-update-email-notification-template/1

Conversation

@cycomachead

Copy link
Copy Markdown
Contributor

General Info

Changes

Updates the pending requests digest email to include richer context for course staff: a link to the course page, a link to the requests page with the full server URL, a summary of auto-approved requests within the notification window, and a bulleted list of individual pending requests with student name, assignment, days requested, and a direct review link.

Key changes:

  • PendingRequestsMailer is now a real ActionMailer class (previously wrapped EmailService with inline string templates). Email body is rendered from ERB views (app/views/pending_requests_mailer/pending_requests_email.html.erb and .text.erb), and the email is now multipart HTML + plain text.
  • PendingRequestsNotificationJob now loads the full pending request records (with user and assignment preloaded) and counts auto-approvals within the window matching the digest frequency (hourly/daily/weekly).
  • Course#course_link / Course#requests_link added to centralize absolute URL generation. Request#request_link is now public and delegates to course.requests_link, removing duplicated host-normalization logic.
  • The per-request list is capped at 50 entries, with an "…and N more" line linking to the requests page for very large courses.

Testing

  • Updated spec/jobs/pending_requests_notification_job_spec.rb with assertions for course links, per-request lines, auto-approval window counting (including that stale approvals outside the window are excluded), and per-frequency wording.
  • Added spec/mailers/pending_requests_mailer_spec.rb covering reply-to handling, HTTPS defaulting for schemeless APP_HOST, per-frequency period labels, nameless-user fallback, and list truncation.
  • Full suite passes: 707 examples, 0 failures. RuboCop reports no offenses.

Screenshots

Rendered HTML email preview

Documentation

No documentation changes required.

Checklist

  • Name of branch corresponds to story

Superconductor Ticket Implementation | App Preview | Guided Review

Refactor the pending requests notification to use ERB templates and
provide more context to course staff. The email now includes:
- Full course name, semester, and links to the course and requests page.
- A summary of auto-approved requests within the notification window.
- A detailed list of individual pending requests (capped at 50).
- Improved link generation logic and multi-part HTML/text support.

Co-authored-by: Claude Code <noreply@anthropic.com>
@cycomachead
cycomachead merged commit b82560e into main Aug 6, 2026
1 check passed
@cycomachead
cycomachead deleted the cycomachead/224-update-email-notification-template/1 branch August 6, 2026 19:52
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