form block editing
Permalink
Hello
i am using form block at 2 pages of my website.i want to send an email to the user who filled that form. sending email to the address user entered is easy like this
in this code i'm user address he entered in QA Pair9.this code is working perfectly fine on page 1. but on second form it's giving error because there is no QA Pair9. in 2nd form email address is on QA pair15.
Can i put if else condition? or i have to code another block for 2nd form?
i am using form block at 2 pages of my website.i want to send an email to the user who filled that form. sending email to the address user entered is easy like this
$mh = Loader::helper('mail'); $mh->to( $questionAnswerPairs[9]['answer'] ); $mh->from( $sender ); $mh->addParameter('formName', $this->surveyName); $mh->addParameter('questionSetId', $this->questionSetId); $mh->addParameter('questionAnswerPairs', $questionAnswerPairs); $mh->load('block_form_submission_user'); $mh->setSubject(t('%s Enquiry', $this->surveyName)); //echo $mh->body.'<br>'; $mh->sendMail();
in this code i'm user address he entered in QA Pair9.this code is working perfectly fine on page 1. but on second form it's giving error because there is no QA Pair9. in 2nd form email address is on QA pair15.
Can i put if else condition? or i have to code another block for 2nd form?