Answers.Body: <p>In the message template, put this in the <code>&lt;body&gt;</code> section of the html format section and then send yourself a contribution receipt.</p>
  
  <pre><code>{assign_debug_info}
  &lt;table id="table_assigned_vars"&gt;
      {section name=vars loop=$_debug_keys}
          &lt;tr class="{cycle values="odd,even"}"&gt;
              &lt;th&gt;{ldelim}${$_debug_keys[vars]|escape:'html'}{rdelim}&lt;/th&gt;
              &lt;td&gt;{$_debug_vals[vars]|@debug_print_var}&lt;/td&gt;&lt;/tr&gt;
      {/section}
  &lt;/table&gt;
  </code></pre>
  
  <p>This does basically the same thing as using <code>{debug}</code> in regular smarty templates to see the variables in the UI.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-17T05:59:39.633Z
Answers.LastActivityDate: 2019-09-17T05:59:39.633Z
Answers.UserDisplayName: Demerit
Body: <p>My CiviCRM 5.16.
  When I try to add fields to receipt template, I discovered that I could add {$line.contribution_id} which shows the record ID of the contribution.
  But adding {$line.creditnote_id} (which is also a field in table civicrm_contribution) shows nothing.</p>
  
  <p>How can I know (or change) the data fields that are available for me to show on the receipts?</p>
  
  <p>Thank you.</p>
  
Tags: <civicontribute><receipts><templates><fields>
Title: What data fields are available to me at receipt template
ThreadText: # What data fields are available to me at receipt template
  
  (Asked by: username_0 on 2019-09-17)
  
  My CiviCRM 5.16.
  When I try to add fields to receipt template, I discovered that I could add {$line.contribution\_id} which shows the record ID of the contribution.
  But adding {$line.creditnote\_id} (which is also a field in table civicrm\_contribution) shows nothing.
  
  How can I know (or change) the data fields that are available for me to show on the receipts?
  
  Thank you.
  
  **Tags:** civicontribute, receipts, templates, fields
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-09-17. Score: 3 | Accepted answer
  
  In the message template, put this in the `<body>` section of the html format section and then send yourself a contribution receipt.
  
  ```
  {assign_debug_info}
  <table id="table_assigned_vars">
      {section name=vars loop=$_debug_keys}
          <tr class="{cycle values="odd,even"}">
              <th>{ldelim}${$_debug_keys[vars]|escape:'html'}{rdelim}</th>
              <td>{$_debug_vals[vars]|@debug_print_var}</td></tr>
      {/section}
  </table>
  
  ```
  
  This does basically the same thing as using `{debug}` in regular smarty templates to see the variables in the UI.
  
  
  ---
  
  