Answers.Body: <p>If you look at the event confirmation template you'll see some sections with constructs like this:</p>
  <pre><code>{assign var=&quot;greeting&quot; value=&quot;{contact.email_greeting}&quot;}{if $greeting}&lt;p&gt;{$greeting},&lt;/p&gt;{/if}
  </code></pre>
  <p>You can edit the template and include something similar for your tokens.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-18T17:28:33.060Z
Answers.LastActivityDate: 2021-08-18T17:28:33.060Z
Answers.UserDisplayName: Aidan
Body: <p>I have a set of tokens that sometimes has values in them, and sometimes not.</p>
  <p>How can I send an email where labels only are visible when value is filled?</p>
  <p>Example:
  I want to send an event registration confirmation letter. In the event signup form, I have several custom fields, that are stored in in the particiapant record.</p>
  <p><strong>Example</strong>:</p>
  <p><em>Your info;
  Number of rooms: «tokenvalue.customfield1»</em></p>
  <p><strong>Example when token value is filled:</strong></p>
  <p><em>Your info;
  Number of rooms: 2</em></p>
  <p><strong>Desired behaviour when token value is not filled:</strong></p>
  <p><em>Your info;</em></p>
  <p><strong>Current behaviour when value is not filled:</strong></p>
  <p><em>Your info; Number of rooms:</em></p>
  <p>Any tip or pointers are welcome!</p>
  
Tags: <civievent><tokens>
Title: How to not show label, when token value is empty?
ThreadText: # How to not show label, when token value is empty?
  
  (Asked by: username_0 on 2021-08-18)
  
  I have a set of tokens that sometimes has values in them, and sometimes not.
  
  How can I send an email where labels only are visible when value is filled?
  
  Example:
  I want to send an event registration confirmation letter. In the event signup form, I have several custom fields, that are stored in in the particiapant record.
  
  **Example**:
  
  *Your info;
  Number of rooms: «tokenvalue.customfield1»*
  
  **Example when token value is filled:**
  
  *Your info;
  Number of rooms: 2*
  
  **Desired behaviour when token value is not filled:**
  
  *Your info;*
  
  **Current behaviour when value is not filled:**
  
  *Your info; Number of rooms:*
  
  Any tip or pointers are welcome!
  
  **Tags:** civievent, tokens
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-18. Score: 1
  
  If you look at the event confirmation template you'll see some sections with constructs like this:
  {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if}
  
  You can edit the template and include something similar for your tokens.
  
  
  ---
  
  