2

Trying to add the campaign name to my automatic receipts.

This works: {$formValues.campaign_id}

But this doesn't: {$formValues.campaign_name} or {$formValues.campaign_title}

I need to print the campaign name and not id.

How can I add the Campaign name to my receipt

1 Answer 1

3

If you can get campaign id ({$formValues.campaign_id}) then you can use api to retrieve the Campaign Title. Use below snippet to get the Title

{if $formValues.campaign_id} 

  {crmAPI var='campaignTitle' entity='Campaign' action='getvalue' sequential=0 return="title" id="`$formValues.campaign_id`"}
  {$campaignTitle}
{/if}

Note: The snippet code is not tested but you can use the logic to get the title

HTH

Pradeep

3
  • thanks for the response. I tried this but it prints: Array It seems to work in the API explorer but not in the template
    – Yossi
    Commented Jun 6, 2019 at 23:05
  • It does work we need use right variable Commented Jun 7, 2019 at 6:54
  • 1
    Updated my answer Commented Jun 7, 2019 at 21:14

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.