Email Handling in WHMCS

Because our gateway facilitates payments both on PayPal’s site, and tokenized payments through WHMCS; it falls into a unique classification in WHMCS – which normally classifies gateways into one of two categories: Third Party Gateway (directs users outside of WHMCS to pay) and Tokenization Gateway (keeps users in WHMCS and bills by a stored token). Third Party Gateways will send the “Invoice Created” email template, whilst Merchant and Tokanisation Gateways will send the “Credit Card Invoice Created” email template.

Because of this, WHMCS has been known to send out two emails on invoice creation and invoice payment for our gateway – because it falls into both of these categories. As of WHMCS 7.2, we have confirmed that WHMCS no longer sends out duplicate emails when an invoice is created with our gateway as a payment method.

By default, WHMCS sends out two emails when an invoice is paid with our gateway: ‘Credit Card Payment Confirmation’ and ‘Invoice Payment Confirmation’. So, by default, we block the ‘Credit Card Payment Confirmation’ email, so the user only receives one email:  ‘Invoice Payment Confirmation’. If you would prefer the user to recieve the ‘Credit Card Payment Confirmation’ instead of the ‘Invoice Payment Confirmation’, then you may turn this switch on in our addon configuration.


How can I customize my email content to be conditional on whether or not my client has a Billing Agreement ID?
Simply edit the email template and use the following if/else smarty tags to specify conditional content for that email. The example below is intended for a Payment Reminder email.

{if $invoice_payment_method eq “PayPal”}
Since you have a Billing Agreement ID ({$client_gateway_id}) on file with us, your invoice will be automatically captured X days before it is due.
You do not have a Billing Agreement ID on file with us, so you will need to manually login and pay your invoice before the due date.

Updated on December 16, 2017

Was this article helpful?