This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Section Break in Emails
Started 16 years ago by sloganmedia | 42 posts |
-
hi Yuniar,
it is possible to make the field "section break" display by default in all emails in every form (actually when i send a form via email this field doesnt show) i need by deafult that field will be sent in all my forms
Posted 16 years ago # -
Hmm.. section break is indeed not being displayed, since this is not part of user submission.
However, I've received similar requests for the last few days. I suppose more people need this.
Ok, you will need to modify includes/entry-functions.php file.
On line 214 you'll find this:
where form_id='$form_id' and element_type <> 'section' {$admin_clause}
replace it with this one
where form_id='$form_id' {$admin_clause}
Next, on line 414 you'll find this:
}else{ //element with only 1 input if(!empty($entry_data['element_'.$element_id])){ $entry_details[$i]['value'] = $entry_data['element_'.$element_id]; } }
replace it with this:}elseif ('section' == $element_type){ $entry_details[$i]['value'] = ' '; }else{ //element with only 1 input if(!empty($entry_data['element_'.$element_id])){ $entry_details[$i]['value'] = $entry_data['element_'.$element_id]; } }
that would display section breaks.MachForm Founder
Posted 16 years ago # -
Hi, thank for you reply Yuniar
The form (in email) just display the "Title" (section break), but doesn´t display the "Description" (in section breaks)...
Posted 16 years ago # -
Hmm.. I'm afraid adding the description won't be as simple as the title. Sorry.
MachForm Founder
Posted 16 years ago # -
I think this is simliar to my needs. The '{entry_data}' seems all bunched together and I have had several requests to put spaces into the email result. Would the above work by simply adding breaks and changing the PHP with the above changes?
Thanks
-tom
Posted 16 years ago # -
have you tried the above hack?
MachForm Founder
Posted 16 years ago # -
Hi yuniar
I just tried the hack and got this error:
Parse error: syntax error, unexpected T_STRING
My Forms/machform/includes/entry-functions.php on line 413
LeePosted 15 years ago # -
yuniar
change it back to this:
}else{ //element with only 1 input
if(!empty($entry_data['element_'.$element_id])){
$entry_details[$i]['value'] = $entry_data['element_'.$element_id];
}
}and still the the error:
Parse error: syntax error, unexpected T_STRING
My Forms/machform/includes/entry-functions.php on line 413What Now?
LeePosted 15 years ago # -
yuniar
I got it corrected if you read this,
I would still like to know if there is some way I can get the section breaks to show up in the emailsPosted 15 years ago # -
Hi Lee,
The above code should display the section break in the emails.
If you are having trouble, can you send me your entry_functions.php file?I'll check it.
Please send to: customer.service [at] appnitro.comMachForm Founder
Posted 15 years ago # -
Thanks for the reply yuniar, here is the entry_functions.php file.
It doesn't have any changes
I got the error and then changed it back
Lee--[admin edit] content removed, please don't paste the whole file in the forum --
Posted 15 years ago # -
Hi Lee, please send as attachment to: customer.service [at] appnitro.com
Send me the modified file, so I can see in which part you are having the error and fix it.
MachForm Founder
Posted 15 years ago # -
yuniar
Sorry About Posting The file, guess I should had look over posting.
About the line break showing up, I got It.
Thanks yuniar
Great Product
can't wait for the new version
LeePosted 15 years ago # -
Thanks for posting this idea. It will certainly help.
WebSight
Posted 15 years ago # -
I modified includes/entry-functions.php per your instructions posted above.
Works great.
Is it possible when confirming the form and viewing the entries, to display the text in the section brake all the way across the page instead of just the left field ?
Posted 14 years ago # -
usvi4me -- there are few other files which need to be adjusted to make it that way. You can contact us directly via email and we'll send you the files.
Please send to: customer.service [at] appnitro.com
MachForm Founder
Posted 14 years ago # -
For those asking about including the section break description, here are the modifications that worked for me.
Use this at your own risk and make sure you have a backup of the original file!!
You will need to modify a default includes/entry-functions.php file.
On or near line 206 you'll find this:
$query = "select element_id, element_type, element_constraint, element_title from <code>ap_form_elements where form_id='$form_id' and element_type <> 'section' {$admin_clause} order by element_position asc";
Replace it with this:
$query = "select element_id, element_type, element_constraint, element_title, element_guidelines from <code>ap_form_elements where form_id='$form_id' {$admin_clause} order by element_position asc";
On or near line 226, you'll find this:
$form_elements[$i]['element_constraint'] = $row['element_constraint'];
Replace it with this:
$form_elements[$i]['element_constraint'] = $row['element_constraint']; $form_elements[$i]['element_guidelines'] = $row['element_guidelines'];
On or near line 423 you find this:
}else{ //element with only 1 input if(!empty($entry_data['element_'.$element_id])){ $entry_details[$i]['value'] = $entry_data['element_'.$element_id]; } }
Replace it with this:
}elseif ('section' == $element_type){ $entry_details[$i]['label'] = '<i style="color:grey">' . $entry_details[$i]['label'] . '</i>'; $entry_details[$i]['value'] = '<i style="color:grey">' . $form_elements[$i]['element_guidelines'] . '</i>'; }else{ //element with only 1 input if(!empty($entry_data['element_'.$element_id])){ $entry_details[$i]['value'] = $entry_data['element_'.$element_id]; } }
Section breaks will be show in grey italics to distinguish them from data. These will show in emails and when using the web based viewer.
Section break information will not show up when exporting to Excel or CSV.Hope that helps.
Posted 14 years ago # -
Any other tricks that could work as did not seem to work for me.
Posted 12 years ago # -
NM. I missed a line of code and now it works. great hack!!!
Posted 12 years ago # -
I am also looking to get the section breaks to show in my email. But my code in includes/entry-functions.php is not matching the hack above. I just purchased this app last week. Perhaps I have a newer version. Can anyone help? Thanks!
Posted 12 years ago #
Reply »
You must log in to post.