Configure multiple order confirmation emails during checkout
Describes how to implement code to configure multiple order confirmation emails during checkout in Classic CMS.
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); }
Updated over 1 year ago