3

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

2 Answers 2

3

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}

0
2

I think this answer is outdated, I can see that the {$invoiceReference} variable is available in the message template - Contributions - Receipt (on-line).

Use the Smarty function in the template to see all the available Smarty variables and their values: {debug output=html}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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