Skip to content

Auto-email on status change (wire dormant cta path) #416

Description

@hamin2006

Context

Status changes made in the reviewer table or on the board are silent — no email fires when an applicant is moved to offered/rejected. The code was designed to support this (cta flag on updateSubmissionField) but no caller ever passes it, so the path is dead code.

Current behavior

  • updateSubmissionField in src/app/portal/admin/actions.ts emails only when cta === true, then only { title, content } from the matched per-status template.
  • No caller passes cta: in-cell updates (columns.tsx) and board drop-to-status (board/page.tsx) both call it without it. Emails are strictly manual via the per-row Notify button.
  • Status history is recorded on every change regardless.
  • There is no per-status "send email on transition?" toggle.

Desired behavior

  • Optional auto-email when an application transitions to a status that has a saved email template, controlled per status (config flag, e.g. config.application.status[i].emailOnTransition, default off to preserve current behavior).
  • Cell dropdown changes and board drag-drop both honor the flag.
  • Opt-out escape hatch per application/row (e.g. do not email if an admin manually toggles, or "notify without email" action) so the flag never forces an email.
  • Reuse existing renderStatusEmail template + tag rendering; failures toast without losing the status change.

Acceptance criteria

  • Per-status emailOnTransition flag exists and is surfaced in the status/template settings UI
  • Table and board transitions both trigger the email when enabled (and never send when disabled)
  • Existing behavior unchanged for current forms (flag defaults off)
  • Failure of the email send does not roll back the status change; error is surfaced

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BacklogNot in the works at the momentfeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions