1

I'm coming from Wordpress and really enjoying craft. I wonder though if it is possible to create a contact form without any plugins? And if so, how easy/worthy of an effort is is? In WP I would create a form, with an action targeting a php file. This php file would do all the form processing, and output a confirmation message. The whole thing would involve 3 files at most (the form template file, the php form processing script, and some js file).

Thanks for your feedback.

1 Answer 1

1

The difference between a plugin and 3 files in WordPress is that a plugin encapsulates the behavior in a defined way. This is an improvement over just writing random PHP scripts, even if there is more formality to it.

You could do it via a custom module (which would be part of your site) with just one controller (analogous to your PHP file in WordPress). See the article Enhancing a Craft CMS 3 Website with a Custom Module

You could also use the pre-fab Contact Form plugin from Pixel & Tonic.

And finally, you could use GraphQL to do it without any plugins/module, or writing any custom PHP. See GraphQL for Contact Form Submissions

1
  • Amazing. Thank you for sharing all this resources.
    – mauricio
    Oct 4, 2021 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.