Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update online event workflow template for more consistent participant amount data and preview-ability #26574

Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jun 19, 2023

Overview

Update online_event_template to use workflow message

This updates the default online event template to use the variables assigned by
the workflow template

Re the helpful discussion at
#24576

The expectation is that the primaryParticipant gets the values for
all participants whereas the others only get line items,
tax breakdowns, totals that relate to them.

Before

  • In ipn mode there are more e-notices and participant data is not loaded for financial stuff for additional participants
  • output for additional participants cannot be seen in the Message Admin preview

After

  • the new preferred way of loading variables in the WorkflowMessage is used
  • the reference to lineItem is replaced by lineItems (slightly less nested & more accurately named) in line with other templates
  • we use tokens for the contribution total amount & tax amount
    https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates
  • we no longer refer to the mystical dataArray
  • less notices
  • I realised the taxBreakdown in the contributionTrait was replacing, not adding to it's array so I fixed that
  • new assigned array participants is always avaialble and the template can show all or just the particular participant, depending on whether it is the primeary
  • message preveiw works
  • does not fatal if secure smarty is enabled

Screenshots from my test - thank you page

image

Main participant

image

image

Second participant

image

Third

image

Technical Details

I left several things out of scope - notably the participant profiles & the mystical 'amounts' section

Comments

@civibot
Copy link

civibot bot commented Jun 19, 2023

(Standard links)

@civibot civibot bot added the master label Jun 19, 2023
@eileenmcnaughton eileenmcnaughton force-pushed the event_preview_template_update branch 2 times, most recently from e18d844 to 896f8f9 Compare June 20, 2023 23:39
@eileenmcnaughton eileenmcnaughton changed the title Event preview template update Update online event preview template for more consistent participant amount data and preview-ability Jun 22, 2023
@eileenmcnaughton eileenmcnaughton force-pushed the event_preview_template_update branch from 896f8f9 to 2cad7a6 Compare June 23, 2023 16:45
@eileenmcnaughton eileenmcnaughton changed the title Update online event preview template for more consistent participant amount data and preview-ability Update online event workflow template for more consistent participant amount data and preview-ability Jun 23, 2023
@eileenmcnaughton eileenmcnaughton force-pushed the event_preview_template_update branch from 2cad7a6 to 95cca3f Compare June 23, 2023 18:47
@eileenmcnaughton eileenmcnaughton force-pushed the event_preview_template_update branch 5 times, most recently from 0b03b91 to 251e493 Compare June 23, 2023 23:02
@eileenmcnaughton eileenmcnaughton force-pushed the event_preview_template_update branch 3 times, most recently from 78297e6 to 198b3cc Compare June 24, 2023 00:33
This updates the default online event template to use the variables assigned by
the workflow template

This works to standardise the variables previously in dataArray
, lineItem, totalAmount, taxAmount to reflect the
approach in other templates per
https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates

However, for participants, per the helpful discussion at
civicrm#24576

the expectation is that the primaryParticipant gets the values for
all participants whereas the others only get line items,
tax breakdowns, totals that relate to them.

Hence I have assigned an array participants that holds detials for all participants
and the template iterates through them showing all or just the
one that relates to the assigned participant id depending on
whether it is primary.

This allows the template to display in the Message preview and should
also mean that those values that I have addressed will always reflect
the participantID being used. This also addresses some notices
and incompatibility with secure smarty.

However, there are still values I haven't made sense of, or otherwise left
out of the scope of this PR in the template.

Also note I updated the taxBreakdown in the contribution trait - I decided it
was cloberring the amount as it iterated through the line items - rather than
doing a running total.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants