0

We're running ExpressionEngine 3.5.17 and using the in-built contact form.

We have a requirement whereby if someone completes the "From" email address on the form, and it originates from a certain domain - let's say example.com - the email should not be sent.

The problem with this is I can't see what to modify/extend in EE which would make this possible.

The form is fairly basic in that we are using tags in a template:

{exp:email:contact_form recipients="foo@bar.com" form_id="downloadResourceForm" redirect="none" charset="utf-8"} 

    <!-- Form fields -->

    <input type="email" class="form-control" id="email" name="email" placeholder="Email address" required>

    <!-- More form fields -->

{/exp:email:contact_form}

I understand that in vanilla PHP I could access the "email" field in the POST data with $_POST['email']. However I don't know how to interact with this because EE is handling the form submission via it's own scripts.

I'm also aware of not modifying EE core files - so how do you "override" the EE code in a way that makes upgrades safe?

0

In stead of using in built exp:email:contact_form modifying core files of EE I am suggesting you to use FormGrab. This plugin is very simple and easy to use. You can create and integrate Contact form very easily.

To achieve your requirement (interact with POST) this plugin has hook from which you can modify and validate the data by creating simple extension file.

And main thing is, it comes up with no Cost. It is free. I think this plugin suits your requirement.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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