Subject as a form field to be filled in by visitors

Hello dear Blocs users!

I’ve asked about this before, unfortunately it’s not built into Blocs. A customer would like to have a subject field in the email form. Is there a trick how I can implement this with the Blocs form?

Thanks for your tips!

Hi @wolfganghofer,

It is only coming up to your one year anniversary of asking, so you have a few more to go :wink:. But your suggestion is excellent, forms are a vital part of any websites, and basic customisation is still missing here, even though the option to use PHPmailer was added.

You can however work around that.

  1. Add an input field for subject.
  2. After exporting your project open the form php file found in the includes folder
  3. Edit this following line (screenshot below), and use the variable assigned to your subject field (it will be shown near the top of the php file) instead of the $email_subject.

CleanShot 2025-01-20 at 07.56.22@2x

Then just exclude updating this file when you update the site, unless you modify the form.

2 Likes

Hi Pete, nice to read you here more often again!
Thanks, I’ll try it out tomorrow