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


  1. sloganmedia
    Member

    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 15 years ago #
  2. yuniar

    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'] = '&nbsp;&nbsp;';	
    
    }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 15 years ago #
  3. sloganmedia
    Member

    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 15 years ago #
  4. yuniar

    Hmm.. I'm afraid adding the description won't be as simple as the title. Sorry.


    MachForm Founder

    Posted 15 years ago #
  5. thomasmagee
    Member

    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 15 years ago #
  6. yuniar

    have you tried the above hack?


    MachForm Founder

    Posted 15 years ago #
  7. lee
    Member

    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
    Lee

    Posted 15 years ago #
  8. lee
    Member

    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 413

    What Now?
    Lee

    Posted 15 years ago #
  9. lee
    Member

    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 emails

    Posted 15 years ago #
  10. yuniar

    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.com


    MachForm Founder

    Posted 15 years ago #
  11. lee
    Member

    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 #
  12. yuniar

    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 #
  13. lee
    Member

    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
    Lee

    Posted 15 years ago #
  14. WebSight
    Member

    Thanks for posting this idea. It will certainly help.

    WebSight

    Posted 15 years ago #
  15. usvi4me
    Member

    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 #
  16. yuniar

    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 #
  17. rob
    Member

    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 13 years ago #
  18. tsoheili
    Member

    Any other tricks that could work as did not seem to work for me.

    Posted 12 years ago #
  19. tsoheili
    Member

    NM. I missed a line of code and now it works. great hack!!!

    Posted 12 years ago #
  20. pamelanilzon
    Member

    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 #

RSS feed for this topic

Reply »