Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

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.

  1. Add the following to the addresses form in CheckoutAddressView/Standard.cshtml:

    <input type="text" ng-model="vm.cart.additionalEmails" />
    
  2. 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;
     }
    }
    
  3. 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);
    }