You are here

private function WebformCivicrmPostProcess::sendReceipt in Webform CiviCRM Integration 8.5

Send receipt

1 call to WebformCivicrmPostProcess::sendReceipt()
WebformCivicrmPostProcess::postSave in src/WebformCivicrmPostProcess.php
Process webform submission after it is has been saved. Called by the following hooks:

File

src/WebformCivicrmPostProcess.php, line 323
Front-end form validation and post-processing.

Class

WebformCivicrmPostProcess

Namespace

Drupal\webform_civicrm

Code

private function sendReceipt() {

  // tax integration
  if (!is_null($this->tax_rate)) {
    $template = \CRM_Core_Smarty::singleton();
    $template
      ->assign('dataArray', [
      "{$this->tax_rate}" => $this->tax_rate / 100,
    ]);
  }
  if ($this->contributionIsIncomplete) {
    $template = \CRM_Core_Smarty::singleton();
    $template
      ->assign('is_pay_later', 1);
  }
  \Drupal::service('webform_civicrm.utils')
    ->wf_civicrm_api('contribution', 'sendconfirmation', $this
    ->getReceiptParams());
}