2

I need to send Invoice number in the message templates for Membership Receipt Online, but I don't see any token or variables associated for Invoice Number which I can use to place it

is there any way we can place the invoice number in the message templates ?

2

The tokens you can use in a message template are a bit random, just what the developer added to the template. In this case, the contribution id can be found with {$contributionID}. However, that is not the same as the invoice_number. I could not find a token for the invoice number. But the templates are generated by smarty, and in smarty you can use the CiviCRM api. So the following line gets the invoice number:

{crmAPI var='invoiceReference' 
        entity='Contribution' 
        action='getvalue' 
        return="invoice_id" 
        id=$contributionID}

You can print it with {$invoiceReference}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.