BC used to have a workflow email that could be setup for all forms that are submitted from an Event that could have details about the event itself included. The only thing I can find in Treepl is the actual Webform Autoresponder email which wont work as we use the one form on multiple events and each event needs their own custom autoresponder email information. Does anyone have a work around here?
We are customizing the autoresponder mail for our booking web form with the help of the formSubmissionData
object. We customize the form so it also submits the event id. Then in the autoresponder code we call the event module using the event id to retrieve all kind of spezific info about the event the user has booked.
@TimL so would it work to have custom fields setup where the customer enters what they want in the webform autoresponder and inject that into it? Is that what you are doing?
Also, how do you add the event id into the webform?
@SiroccoDigital In our use case the booking form sits on the detail page of the event so if you use the form with a component code the event id would be available as {{this.parent.id}}
. I made a custom field EventID in my booking form and populated it like this <input type="text" id="EventID" name="EventID" value="{{this.parent.id}}">
.
On the form results page and in the autoresponder email {% component source: "Event", layout: "", filterBy: "id", filterValue: "{{ this.formSubmissionData.Fields.Custom.EventID.Value }}", limit: "1", enablePagination: "false", object: "collection", collectionVariable: "eventdetails", type: "module" %}
will give you a collection with all the data sitting in the event item.
Iāve also set up custom fields the customer can fill when booking an event. Their data is available on the results page and in autoresponder email via {{ this.formSubmissionData.Fields.Custom.[custom field name].Value }}
.
@SiroccoDigital I can also show you through the code on Zoom quickly if you like.
@TimL I did the following setup -
- Add a form field called āEmail Autoresponderā to the Event Layouts.
- Add a form field called āEvent IDā to the webform
- Added the field to the webform as
<input type="text" style="display: none;" id="EventID" name="EventID" value="{{this.parent.id}}">
- To the email autoresponder added
{% component source: "Event", layout: "", filterBy: "id", filterValue: "{{this.formSubmissionData.Fields.Custom.EventID.Value}}", limit: "1", enablePagination: "false", object: "collection", collectionVariable: "eventdetails", type: "module" %}
and
{{this.formSubmissionData.Fields.Custom.EmailAutoresponder.Value}}
- To the āform-submission-resultsā system page
{% component source: āEventā, layout: āā, filterBy: āidā, filterValue: ā{{this.formSubmissionData.Fields.Custom.EventID.Value}}ā, limit: ā1ā, enablePagination: āfalseā, object: ācollectionā, collectionVariable: āeventdetailsā, type: āmoduleā %}
It comes through blank still and I have populated content on that field. Let me know your thoughts.
Hi @SiroccoDigital. Hopefully Tim can have a look at your setup, but I think instead of that last line you posted it should just be:
{{eventdetails.EmailAutoresponder}}
To output the Event autoresponder content.
This didnāt work either unfortunately @Adam.Wilson.
Oh, sorry, my bad. Try:
{{eventdetails.items[0].EmailAutoresponder}}
Otherwise, Iāll stay out of it and let Tim have a look
Well @Adam.Wilson you did it again! That absolutely nailed it. Love your work mate
Thanks for all your help on this @TimL it is most appreciated.