+ $emailValues = $form->_values;
+ // Finally send an email receipt for pay-later scenario (although it might sometimes be caught above!)
+ if ($totalAmount == 0) {
+ // This feels like a bizarre hack as the variable name doesn't seem to be directly connected to it's use in the template.
+ $emailValues['useForMember'] = 0;
+ $emailValues['membership_assign'] = 1;
+ $emailValues['amount'] = 0;
+ }