Configure multiple order confirmation emails during checkout
2 min
Important
Classic CMS reached end-of-life in January 2025 and is no longer receiving feature updates or bug fixes. You should [migrate to Spire CMS](../../End user docs/spire-cms/get-started-with-spire-cms/migrate-from-classic-cms-to-spire-cms.mdx).
You can use backend code to configure multiple order confirmation emails during checkout in Classic CMS and build your UI around this customization.
- Add the following to the addresses form in CheckoutAddressView/Standard.cshtml:
<input type="text" ng-model="vm.cart.additionalEmails" />- Validate this field in the continueCheckout method of insite.checkout-address.controller.ts. The following code is an example:
if (this.cart.additionalEmails) {
const emailRegex = /\w+([-+."]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
if (!this.cart.additionalEmails.split(",").every(o => emailRegex.test(o))) {
// show some error for additional emails input
return;
}
}- Send additionalEmails field to the server by calling the following code in the updateSessionCompleted method of insite.checkout-address.controller.ts:
if (this.cart.additionalEmails) {
this.cartService.updateCart(this.cart);
}