Send e-mail confirmation after submitting external form
Permalink
Hi there,
Can anyone explain to me how to send an e-mailconfirmation when a form is submitted by the user? I'm trying to develop this piece of functionality based on the test_form which is default shipped in Concrete5-5.7. Thanks in advance.
Kind regards,
Henco
Can anyone explain to me how to send an e-mailconfirmation when a form is submitted by the user? I'm trying to develop this piece of functionality based on the test_form which is default shipped in Concrete5-5.7. Thanks in advance.
Kind regards,
Henco
In your controller after you do all your validation and whatever you can add something like this
Hi hutman,
Thanks for your reply! Unfortunately my PHP skills are not that wel developed, so I hope you are willing to help a step further.
Enclosed you find the code of the test_form.php. Could you please give me a hint where to place the mentioned code in the php file. Just to see how the e-mail piece will work. From that point on I think I am able to develop the form as I want to.
Thanks!
Thanks for your reply! Unfortunately my PHP skills are not that wel developed, so I hope you are willing to help a step further.
Enclosed you find the code of the test_form.php. Could you please give me a hint where to place the mentioned code in the php file. Just to see how the e-mail piece will work. From that point on I think I am able to develop the form as I want to.
Thanks!
<?php namespace Concrete\Block\ExternalForm\Form\Controller; use Concrete\Core\Controller\AbstractController; class TestForm extends AbstractController { public function action_test_search($bID = false) { if ($this->bID == $bID) { $this->set('response', t('Thanks!')); return true; } } public function view() { $this->set('message', t('This is just an example of how a custom form works.'));
Viewing 15 lines of 17 lines. View entire code block.
I'm not exactly sure what you are trying to do, but if you put that in the action_test_search function it will send an email each time the form is submitted. You'll need to update the to and from email addresses.
Thanks again, will try that!