Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • JGKN 26 posts 172 karma points
    Feb 06, 2022 @ 17:29
    JGKN
    0

    Formulate Line Breaks

    I'm using formulate (v3.5.2) for some simple contact us forms on the website I am working on, and it works well but for one annoying issue - there are no line breaks for text areas.

    Its such a small issue, but effectively makes really long emails almost unreadable on arrival.

    What's strange is you can add in multiple line breaks by pressing enter in the text area on the front end (when filling out the form), but these get stripped out in the received email, as well as in the formulate submissions in the CMS.

    Am I missing a simple way of fixing this?

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Feb 07, 2022 @ 22:05
    Nicholas Westby
    0

    I suspect the issue is that line break characters are ignored as whitespace in email and when presented in the back office.

    The simplest thing to do would be to submit a pull request.

    First you'll want to create an issue here: https://github.com/rhythmagency/formulate/issues

    Then you'll want to create a pull request.

    My guess is the FormatValue function is the place you'll want to focus on implementing a solution: https://github.com/rhythmagency/formulate/blob/v3/master/src/formulate.app/Forms/Fields/TextArea/TextAreaField.cs#L30

    Some other places you may need to look:

    • Potentially add some br tags when line breaks are detected in the code that sends emails.
    • Potentially use some CSS to add line breaks in the back office.
  • JGKN 26 posts 172 karma points
    Jun 22, 2022 @ 16:15
Please Sign in or register to post replies

Write your reply to:

Draft