Form Block: How do you retrieve form values for use in a confirmation email?
Permalink 1 user found helpful
OK... so I'm struggling through making modifications to enable two different things:
(1) I want to have a confirmation email sent to the person who completed the form on the website
(2) There's a set of checkboxes on the form (it's a brochure request form) identifying what documents they are interested in. I'd like to have the confirmation email include links to PDFs (ideally stored in the FileManager) for the brochures that they requested.
So... for #1, I'm assuming I need to modify my custom mail block's controller.php and add a second set of this code:
What I don't know is how to get the email address the user added to the form into the $mh->to(); line.
And how would I go about looping through the values selected in the Checkbox field (called "Brochures Requested") to determine which PDF's need to be linked? And how do I get the link to PDFs that are maintained in the File Manager?
Thoughts? Suggestions? Places you can point me to look?
I appreciate any help you've got!
- John
(1) I want to have a confirmation email sent to the person who completed the form on the website
(2) There's a set of checkboxes on the form (it's a brochure request form) identifying what documents they are interested in. I'd like to have the confirmation email include links to PDFs (ideally stored in the FileManager) for the brochures that they requested.
So... for #1, I'm assuming I need to modify my custom mail block's controller.php and add a second set of this code:
$mh = Loader::helper('mail'); $mh->to( $this->recipientEmail ); $mh->from( $formFormEmailAddress ); $mh->addParameter('formName', $this->surveyName); $mh->addParameter('questionSetId', $this->questionSetId); $mh->addParameter('questionAnswerPairs', $questionAnswerPairs); $mh->load('block_form_submission'); $mh->setSubject(t('%s Submission', $this->surveyName)); @$mh->sendMail();
What I don't know is how to get the email address the user added to the form into the $mh->to(); line.
And how would I go about looping through the values selected in the Checkbox field (called "Brochures Requested") to determine which PDF's need to be linked? And how do I get the link to PDFs that are maintained in the File Manager?
Thoughts? Suggestions? Places you can point me to look?
I appreciate any help you've got!
- John
Josh,
I apologize... it's been a long time since I worked on this project, and I haven't been very active with C5 since.
As I recall, I had to do something with creating "Mail" objects (that go in the /mail folder of your C5 install) and tie them into a modified form block. But I don't remember the specifics as I was playing around with Jordan Lev's Ajax Form and Tableless Layout templates and a bunch of other things.
Have you checked in the Marketplace for any Add-ons that might provide this capability? For instance, the "Extended Form" Add-On (http://www.concrete5.org/marketplace/addons/extended-form/... ) looks like it has a "Notification" option that might do what you need... so long as you don't mind spending the $30 on the Add-On. ;D
Sorry I can't be more help!
- John
I apologize... it's been a long time since I worked on this project, and I haven't been very active with C5 since.
As I recall, I had to do something with creating "Mail" objects (that go in the /mail folder of your C5 install) and tie them into a modified form block. But I don't remember the specifics as I was playing around with Jordan Lev's Ajax Form and Tableless Layout templates and a bunch of other things.
Have you checked in the Marketplace for any Add-ons that might provide this capability? For instance, the "Extended Form" Add-On (http://www.concrete5.org/marketplace/addons/extended-form/... ) looks like it has a "Notification" option that might do what you need... so long as you don't mind spending the $30 on the Add-On. ;D
Sorry I can't be more help!
- John
I'm also looking for a solution to send a confirmation email to a user who just completed a form. It's taking a lot more work to attempt to figure it out, and I expected it to be a basic function!
Have you found any solutions?
- Josh