I have a page collection of events. Each single event page has a contact form. Visually the contact form itself is always the same and defined in the events parent page header.
Then it's displayed in the single pages via include:
{% include "forms/events/form.html.twig" with { form: forms('event-contact-form') } %}
The only thing that needs to be dynamic per event is process.email.to because the contact form data will be send to different people depending on the type of the event. There is a field in the event single template which allows the editors to specify email address where it needs to be sent to. Therefore, setting process.email.to to config.plugins.email.to isn't going to work as it's always static.
I have a page collection of events. Each single event page has a contact form. Visually the contact form itself is always the same and defined in the events parent page header.
Then it's displayed in the single pages via include:
{% include "forms/events/form.html.twig" with { form: forms('event-contact-form') } %}
The only thing that needs to be dynamic per event is
process.email.to
because the contact form data will be send to different people depending on the type of the event. There is a field in the event single template which allows the editors to specify email address where it needs to be sent to. Therefore, settingprocess.email.to
toconfig.plugins.email.to
isn't going to work as it's always static.What is the best way to achieve this?