Skip to content

[Quotes]: Email the company when a quote is approved or rejected in the client portal #672

Open

Description

@nielsdrost7

v1 notified the quote's owner by email whenever a guest approved or rejected a quote: email_quote_status() (application/helpers/mailer_helper.php:178-210), called from application/modules/guest/controllers/Quotes.php:166,199 and View.php:266,291 — subject/body built from quote_status_email_subject/quote_status_email_body translations with client name, status, quote number, and a link to the quote view.

Blocked by: #392 (Client Portal / customer accounts) — there is no v2 surface where a client can approve/reject yet. File now so the portal work inherits the requirement; also relates to #259.

Specific

When a portal user (or signed guest link) sets a quote to Approved/Rejected:

  1. Queue a notification mail to the quote's owning user (quote.user_id email; fallback company email) — no template needed, translation-driven strings like v1 (ip.quote_status_email_subject / ip.quote_status_email_body with client name, localized status, quote number, and an internal link to EditQuote).
  2. Send only on the portal-driven transition, not when staff change status in the company panel.
  3. Log a MailQueue row against the quote ([Invoices] Create/update MailQueue record to log email delivery (timestamp, recipient, status) #527).

Measurable

Portal approval produces exactly one mail to the owner with the correct subject; staff-side status edits produce none.

Achievable

Listener on the portal's status-change event (to be defined by #392) + one simple Mailable.

Relevant

Quote approval is the moment the seller must act; v1 users rely on this ping and will notice its absence immediately.

Time-Bound

Same milestone as the portal's quote approve/reject feature.

Arrange

Quote (status Sent) owned by user U with email; portal context per #392 test harness; Mail::fake().

Act

Approve the quote through the portal endpoint.

Assert

  • One mailable queued to U's email; subject contains client name, "approved", quote number
  • Body links to the quote's edit page
  • Rejecting sends the "rejected" variant
  • Changing status from the company panel queues nothing
  • mail_queue row logged for the quote
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

    refinedRefined with SMART plan / test suggestions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions