0

I am using a contribution page to sell an item. I would like to enable the receipt section so that people get an email confirmation of their purchase.

My problem is that our receipt (on-line) template uses the subject line "Thank you for your donation - tax receipt for [contribution page title]"

Obviously this is not a donation and no tax receipt will be issued (the non-deductible amount equals the purchase price).

I don't know enough to edit the current code to achieve this, hoping someone can help.

I do need to keep the "if pay later" then "invoice" part as well.

{if $is_pay_later}{ts}Invoice{/ts}{else}{ts}Thank you for your Donation, Tax Receipt for{/ts}{/if} - {$title} - {contact.display_name}

2
  • If you are using a different Financial Type for your 'purchases' then yes i think you should be able to add in some more if/else and keep the PayLater if/else
    – petednz - fuzion
    Commented Nov 2, 2023 at 18:18
  • Yes I am using a different financial type - do you know the code for "if financial type ="?
    – erin
    Commented Nov 2, 2023 at 21:23

1 Answer 1

0

Checked on one of our sites and what I am seeing is that for Financial Type 6 we are using

{if $ft_id == 6}

5
  • I don't think $ft_id is something from core and I don't see it in the code. Is that something custom, possibly assigned to the template from php or maybe a few lines up in your template you have {crmAPI var='ft_id' ...} where you look it up based on the contribution id? In theory as of 5.43-ish you can use {contribution.financial_type_id} but it may not be available in all message templates. If using within a smarty if you might need to surround it with single quotes, but might not be necessary in this specific case, e.g. {if '{contribution.financial_type_id}' == 4}
    – Demerit
    Commented Nov 8, 2023 at 1:00
  • hmm. i see some customisation with *_civicrm_alterMailParams() and "if ($contribution['financial_type_id'] == 6) { $params['tplParams']['logoURL'] ="
    – petednz - fuzion
    Commented Nov 8, 2023 at 18:13
  • hopefully your comment has suggestions they can use and then perhaps you should change it to an Answer and I will bury mine
    – petednz - fuzion
    Commented Nov 8, 2023 at 18:13
  • I decided just to change the wording of the subject to "contribution" instead of "donation", that way it works for donations and purchases both!
    – erin
    Commented Nov 14, 2023 at 2:18
  • Love those types of solutions.
    – petednz - fuzion
    Commented Nov 14, 2023 at 18:22

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.