Hello everybody,
I have just set up my first proper form, a simple contact form, to send mails via SMTP, which works nicely. Now I would like to do something a bit more advanced:
I have several similar pages, each featuring a Thing. All of these pages shall have the same form included at the bottom. When somebody fills it out and submits it, they shall be sent an email with a PDF attached about the Thing they were interested in (so that's a page-specific parameter). Another email shall be sent to the site owner to let them know the details of who was interested in which Thing (also page-specific).
I defined this form and include it in the template for these Thing pages like so:
{% include "forms/form.html.twig" with {form: forms('thing-form')}
The problem now seems to be processing each page's details. For example putting the page title in the subject line:
process:
-
email:
subject: "Somebody wants to know more about {{ page.title }}"
body: "{% include 'forms/data.html.twig' %}"
That outputs nothing after "about". Why? The include for body: works just fine. I feel like I might need to put twig: true somewhere, but where?
Thank you for your time and thoughts!