Skip to content

[5.x]: Adding a transaction which completes an order does not respect the suppress emails toggle #4217

@MatthiasBrodelet

Description

@MatthiasBrodelet

What happened?

Description

Context:

  • Our client has a webshop with prices that change every minute (gold and silver).
  • The Open status automatically sends an order confirmation email.
  • I have added custom code so that an order cannot be completed unless there is a transaction defined in the order

When the client creates a manual order in the CP they often need to manually adjust the prices to what they negotiated with the client. This is only possible AFTER the order has been completed. This is why they do not want the client to receive an automatic order confirmation mail when creating a manual order.
That is why we always enable the Suppress emails lightswitch when adding a transaction.
However, it seems like that option is completely ignored.

Image

I could work around it by using an event to block the mail only when the order has been created in the CP but it feels like a dirty trick while the current behaviour feels like a bug.

Steps to reproduce

  1. Create a manual order
  2. Enable the suppress emails lightswitch
  3. Add a transaction that converts the cart to an order

Expected behavior

Since this action triggers a status change we would expect to be able to suppress this email.

Actual behavior

The confirmation mail is not suppressed.

Craft CMS version

5.9.2

Craft Commerce version

5.5.2

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions