Body: <p>I am trying to add a custom behaviour while editing a participant, so that based on several conditions of what the user had chosen as custom fields in the event's registration form, the confirmation email of changing the participant status will have generated the right text.</p>
  
  <p>So I am in Event/Form/Participant.tpl, and need to iterate through my participant's custom fields, and look if specific ones that im looking for exist, and if they do, read them, run them through an algorithm, and generate the matching text.</p>
  
  <p>Any hints how do I do that?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-29T20:36:43.047Z
Comments.Text: Do you mean a custom email entirely your own or one of the existing emails at admin - civimail - message templates - system workflow tab? It sort of sounds like you want to edit one of those message templates.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-29T20:39:35.647Z
Comments.Text: If you mean a brand new type of email, you probably want to use https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-29T21:38:48.247Z
Comments.Text: The thing s I dont want it to happen automatically upon registration. I want it to give the office worker the opportunity to see the generated email and edit it if needed or if there are exceptions. They now use the 'send notification' checkbox and textarea that are available when changing the status of a participant. I think that this place will give the necessary flexibility.
Comments.UserDisplayName: Elad
Tags: <civievent><custom-fields><custom-templates>
Title: Querying participant custom fields in CRM/Event/Form/Participant.tpl
ThreadText: # Querying participant custom fields in CRM/Event/Form/Participant.tpl
  
  (Asked by: username_0 on 2019-03-27)
  
  I am trying to add a custom behaviour while editing a participant, so that based on several conditions of what the user had chosen as custom fields in the event's registration form, the confirmation email of changing the participant status will have generated the right text.
  
  So I am in Event/Form/Participant.tpl, and need to iterate through my participant's custom fields, and look if specific ones that im looking for exist, and if they do, read them, run them through an algorithm, and generate the matching text.
  
  Any hints how do I do that?
  
  **Tags:** civievent, custom-fields, custom-templates
  
  > **Comments:**
  > **username_1**: Do you mean a custom email entirely your own or one of the existing emails at admin - civimail - message templates - system workflow tab? It sort of sounds like you want to edit one of those message templates.  
  > **username_1**: If you mean a brand new type of email, you probably want to use https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/  
  > **username_0**: The thing s I dont want it to happen automatically upon registration. I want it to give the office worker the opportunity to see the generated email and edit it if needed or if there are exceptions. They now use the 'send notification' checkbox and textarea that are available when changing the status of a participant. I think that this place will give the necessary flexibility.  
  
  ---
  
  ## 0 answers
  
  