1

Using version 4.6.9 on Drupal 7. I'm working on a revision to our email template for event registrants, and in our environment, it's important to distinguish between individuals who are awaiting administrative approval (status 8), those with completed registration (status 1), and those assigned to the waitlist(status 7). I thought the variable $participant_status_id would meet my needs, but emails generated after an update to participant status show the previous value for $participant_status_id, not the updated value. Is this how it's supposed to work? What smarty variable do I use to check the updated status?

  • Are the emails triggered right after changing the participant status? There's a scheduled job which takes care of updating the statuses for Waitlist and Awaiting Approval so if the email is triggered right after registration and the Update Participant Statuses scheduled job runs say every 15 minutes, then you have an email with inaccurate data, your smarty variable is correct by the way. Does that clarifies things? – Andrei Feb 23 '16 at 1:09
  • Yes, it's a system-workflow message triggered by checking the "send confirmation" box on the update screen and then saving an update, but I don't think a scheduled job could be updating the statuses because if, after making a change and triggering and email, I immediately return to the record and save it triggering a second email, whether or not I make any additional change to the record, the data will then reflect the new status, regardless of how little time has elapsed. It appears as though the participant status is being read from the DB by smarty too early, before the update takes effect – Jeff Wood Feb 23 '16 at 6:35
  • I just had a look at Civi's default template for online registration, and I was wrong, sorry, the smarty variable is $participant_status so you would do {if $participant_status eq 'Awaiting Approval'}Awaiting Approval{elseif $participant_status eq 'Registerd'}Registered{/if}. Regarding your workflow, I'm not sure if I understand what you mean with 'I immediately return to the record and save it triggering a second email...' – Andrei Feb 23 '16 at 13:03
  • I can imagine this case: participant registers with status Awaiting Approval, he/she receives and email acknowledging their status, admin change his/her status to Pending from Approval, participant then receives a second email to confirm his/her place and proceed to payment if applies and then participant receives a 3rd email with confirmation and payment receipt. Where does you Status fail to update in this workflow? – Andrei Feb 23 '16 at 14:00
  • Thanks for all your attention. I don't see $participant_status in my debug output at all. Is this a new variable in the 4.7 version? In any case, the way this is causing trouble in our scenario is as follows: Participant registers online for a free event that is open to faculty. The status is assigned as Awaiting Approval (which is participant_status_id 8) and an email from the online template is generated saying that the request will be reviewed within some number of hours. – Jeff Wood Feb 23 '16 at 23:06
3

This was posted a while ago, but I thought I should post the solution I finally found to the problem (which still exists in my version 4.7.29 install)

The solution to this problem was an API call. While the value of $participant_status_id shows the value PRIOR to update, with this Smarty code added somewhere near the top of the template:

{crmAPI var='partinfo' entity='Participant' action='get' event_id=$event.id contact_id=$contactID}
{foreach from=$partinfo.values item=participant}{/foreach}</p>

I can then use the variable $participant.participant_status_id which will contain the correct status value reflecting the update made in the "Edit Event Registration" screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.