function voucherClickHandler(e) {
  var voucher = $(e.target);
  var voucher_name = voucher.data('vouchertitle') || "N.A";
  var voucher_desc = voucher.data('voucherdesc') || "N.A";
  //Use Interface APIs to set the editor value
  var voucher_message = `Voucher Code :  ${voucher_name}  - ${voucher_desc}`;
  client.interface.trigger("setValue", { id: "editor", value: voucher_message })
    .then(function () {
      client.instance.close();
    })
    .catch(function (error) {
      console.error("Error occured while setting editor value", error);
      showNotification("alert", "Unable to set the chat editor content. Refer the console for detailed error");
      client.instance.close();
    });
}
/**
 * Handles clicking the voucher. Gets the voucher details and appends it to the message editor automatically
 * @param {*} e 
 */
Handles clicking the voucher. Gets the voucher details and appends it to the message editor automatically
@param {*} e
Handles clicking the voucher . Gets the voucher details and appends it to the message editor automatically @param { * } e
function voucherClickHandler(e) {
  var voucher = $(e.target);
  var voucher_name = voucher.data('vouchertitle') || "N.A";
  var voucher_desc = voucher.data('voucherdesc') || "N.A";
  var voucher_message = `Voucher Code :  ${voucher_name}  - ${voucher_desc}`;
  client.interface.trigger("setValue", { id: "editor", value: voucher_message })
    .then(function () {
      client.instance.close();
    })
    .catch(function (error) {
      console.error("Error occured while setting editor value", error);
      showNotification("alert", "Unable to set the chat editor content. Refer the console for detailed error");
      client.instance.close();
    });
}
function voucherClickHandler ( e ) { var voucher = $ ( e . target ) ; var voucher_name = voucher . data ( 'vouchertitle' ) || "N.A" ; var voucher_desc = voucher . data ( 'voucherdesc' ) || "N.A" ; var voucher_message = ` ${ voucher_name } ${ voucher_desc } ` ; client . interface . trigger ( "setValue" , { id : "editor" , value : voucher_message } ) . then ( function ( ) { client . instance . close ( ) ; } ) . catch ( function ( error ) { console . error ( "Error occured while setting editor value" , error ) ; showNotification ( "alert" , "Unable to set the chat editor content. Refer the console for detailed error" ) ; client . instance . close ( ) ; } ) ; }
Handles clicking the voucher.
Handles clicking the voucher .
//Use Interface APIs to set the editor value