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

[closed] Line Breaks in Email


  1. dustin
    Member

    When receiving the email notification from the submitted form I noticed that the line breaks (in paragraph fields) do not display. However, looking at the actual data in the database the line breaks appear to be there. Is there a simple way to make these line breaks show in the email?

    Posted 17 years ago #
  2. dustin
    Member

    I believe I have this solved - let me know if this is the best way to go about this:

    On line 341 of helper-functions.php you will find:

    $email_data[$i]['value'] = "
    ".htmlspecialchars($value,ENT_QUOTES)."
    ";

    Change it to:

    $email_data[$i]['value'] = "
    ".nl2br(htmlspecialchars($value,ENT_QUOTES))."
    ";

    Walla! now your emails from forms with texareas/paragraphs will have line breaks!

    Posted 17 years ago #
  3. yuniar

    Yep, you have it correct. Thanks for sharing!


    MachForm Founder

    Posted 17 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.