Emails on status changes
Besides the emails at the end of an order, EXT:cart can send emails when the payment or the shipping status of an order is changed, e.g. in the order details of the backend module or by a payment provider. No such emails are configured by default.
Warning
This is an experimental feature. Classes and the configuration may change in minor versions, even incompatibly. Enable it only if you accept to adapt your configuration and templates after an update.
The feature is disabled by default. Enable the feature toggle e.g. in
config/system/additional.php:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['cart.experimental.statusChangeMails'] = true;
Without the feature toggle no emails are sent on status changes, the configuration below is ignored.
Each email is configured for a transition of the status in the site settings
extcode. or
extcode. of the site of the order, e.g. in
config/:
extcode:
cart:
statusChange:
mail:
payment:
pendingToPaid:
from: pending
to: paid
recipients: [buyer]
shipping:
shipped:
from: '*'
to: shipped
recipients: [buyer, seller]
The site is the one of the storage folder of the order, so the emails are sent
on the command line too, e.g. by a command or a scheduler task. The sender and
the recipients are the email addresses of the site settings
extcode. and extcode. of the site set
extcode/, see Email addresses.
The key of a configuration (e.g. pending) is the name of its
template folder, see below.
-
- Type
-
string or list
The old status, a list of status (or several ones separated by commas), or
*for any status.
-
- Type
-
string
The new status.
-
- Type
-
list
buyerand/orseller(or both separated by commas). The email to the buyer is sent to the email address of the billing address, the email to the seller toextcode.. The seller replies to the buyer.cart. mail. seller. to Address
-
- Type
-
string
- Default
-
Mail/Status Change/<Payment |Shipping>/<Key>
The template folder, the template of a recipient is
<template>/orBuyer. html <template>/. By default the folder is the key of the configuration with an upper case first letter, e.g.Seller. html Mail/. WithoutStatus Change/ Payment/ Pending To Paid/ Buyer. html templatethe key may only contain letters and digits and has to start with a letter.
Several configurations may match one change, each sends its emails. The
templates are searched in the template root paths of the email API, see
Overwrite email templates. They get the variables order,
order (with old, new, source and
initiator) and settings (plugin., empty without
TypoScript, e.g. on the command line).
The emails get the attachments of the \Extcode\
like the emails at the end of an order, e.g. the files of
plugin., see Email attachments. The
attachments configured in TypoScript are not available on the command line.
Errors
An email which can not be sent, e.g. because of a missing template, an
invalid configuration, an invalid email address (in the site settings or of
the buyer) or a failing listener of the Attachment, does not undo the
change of the status. The editor gets an error message in the backend, and the
error is written to the order log (tx_, type
status).
If the storage folder of the order is in no site, no emails are sent and a warning is written to the order log.