Prevent mail (commerce_order_receipt) on manual order placement

Created on 4 April 2024, 5 months ago
Updated 4 July 2024, 2 months ago

Problem/Motivation

No way to prevent a mail (commerce_order_receipt) to be sent after placing an order manually, f.e. when admin place the order and not customer.

Steps to reproduce

On the commerce:
Add product to the cart
Create an order
As admin place the order
Notice that a mail was sent

Proposed resolution

Currently, there's no configuration option for disabling emails or divide it by role/product, but it's something we could add to the order type configuration

Remaining tasks

Add an option for configuration of commerce order receipt to be sent based on condition or some logic (like manual placing of order)

Feature request
Status

Active

Version

3.0

Component

Order

Created by

🇺🇦Ukraine jorgik

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jorgik
  • 🇺🇸United States rszrama

    Yeah, this is a weird one. I don't know why order placement was selected instead of checkout completion. That would seem the more natural event to subscribe to for sending a receipt.

  • 🇮🇱Israel jsacksick

    @rszrama: Always the same reason I guess... Checkout completion event was introduced after the event subscriber for sending the receipt was written.
    Also, if for whatever reason the checkout completion event isn't properly fired, the receipt wouldn't be sent I suppose?
    I'm wondering if skipping the redirect to the site after an offsite payment can cause the checkout completion event to be fired?

    If we change this now, then I guess an extra step would be needed in the UI to send the receipt, so definitely a "breaking" change.

  • 🇷🇸Serbia bojanz

    FWIW at the time we considered it an absolute requirement that manually placed orders can also get order receipt emails, as not supporting that was considered notable in 1.x.

    I think there will always be users in both groups (who want and don't want the email to be sent).

  • 🇮🇱Israel jsacksick

    I agree completely with comment #4, if we change this now, then we'll get issues opened about the receipt not being sent for admin orders.
    Ideally, we'd have a checkbox from the state transition confirm form modal that toggles whether the receipt gets sent.

Production build 0.71.5 2024