verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 69 forks source link

How to dynamically pass a file or URL from to visitor response submission email. #1841

Closed mateostabio closed 1 month ago

mateostabio commented 2 months ago

Question

I have landing pages on the site and they are downloadable pages like: ebooks, PDFs, or webinars. These pages contain a Formie form.

Once they fill out the form, I'd like to be able to send them a reply by email with a link or button to the webinar, or to the PDF to go download it.

My client is currently doing it with the Email Content field within the Email Notifications tab, but the issue is that she has to create a different form for every page.

I want to create something a little more dynamic. Ideally by creating a text field on the webinar/PDF landing page entry, my client will add the file that should be downloaded on the landing page entry. This URL and field data should be passed to this form "Email Content". (Also perhaps it would be good to add a link button in your Email Content WYSIWYG.

This would make it possible to have one form for all webinars. And replace the downloadable file dynamically.

Thanks for your help.

Additional context

No response

engram-design commented 2 months ago

There's two different user guides that might be useful here, particularly the latter. Here, you can create the email notification entirely in-memory in Twig, so it's completely dynamic.

You could either create the email notification in Twig from scratch, or alter the email content.

It's probably going to be easier to use the first approach with a module and attach the PDF itself, purely because you have to mess around with the WYSIWYG content which is a ProseMirror schema.