• Resolved cb831

    (@cb831)


    We recently upgraded our WordPress installation and after this we notice that the email sent from a contact form contains linefeeds between labels and values as in

    Email before
    :
    Name: Donald Duck
    City: Duck city
    :

    Email Now
    Name:
    Donald Duck
    City:
    Duck city

    WordPress is version 6.6.2
    Jetpack is version 13.9.1

    As I understand we are using Jetpack contact form.

    The form is (anonymimised a bit)

    [contact-form to="[email protected]" subject="bla bla bla from: {email}"][contact-field label="Type" type="select" required="1" options="Aaa,Bbb,Ccc"][contact-field label="Name" type="name" required="1"][contact-field label="Street" type="text" required="1"][contact-field label="Place" type="text"][contact-field label="ZIP" type="text" required="1"][contact-field label="City" type="text" required="1"][contact-field label="PhoneNo" type="text"][contact-field label="Email" type="email" required="1"][contact-field label="Message" type="textarea"][/contact-form]

    The theme seems to be “Twenty Eleven Child”

    How do we configure WordPress to not add these annoying linefeeds ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Paulina H. (a11n)

    (@pehaa)

    Hi there,

    We recently upgraded our WordPress installation and after this we notice that the email sent from a contact form contains linefeeds between labels and values […]

    I can confirm that Jetpack Contact Form indeed adds linebreak between the labels and values of the submissions. We chose this layout to privilege the clarity.

    The HTML that we use under the hood is:

    <p><strong>label</strong><br /><span>value</span></p>

    It’s possible to customize how the response should be emailed via the jetpack_forms_response_email filter.

    Please note that our support team cannot assist with custom coding. If you are not familiar with using WordPress filters, it might be best to consult an experienced developer

    Thank you!

    Thread Starter cb831

    (@cb831)

    Thank you Paulina – I already found the extra linefeed in jetpack_forms_response_email, but I did not dare to change it as I assumed it would be overwritten on each Jetpack patch/update ??

    How will a modification to the filter affect upcoming updates ?

    • This reply was modified 2 weeks, 5 days ago by cb831.
    Thread Starter cb831

    (@cb831)

    Ohh forget it – I see that the code I found in jetpack-forms/src/contact-form/class-contact-form.php actually checks to see if the ‘jetpack_forms_response_email’ hook is defined and calls it instead of the default code provided (with the unwanted linefeed). And hence the code does not need to be modified.

    Plugin Support Paulina H. (a11n)

    (@pehaa)

    Hi there,

    Indeed, using this filter allows you to customize the email response without modifying the core Jetpack code, which means your changes won’t be overwritten during updates. Just ensure your custom filter is added to your child-theme’s?functions.php?file or via a plugin like?Code Snippets.

    If you have further questions, feel free to reply to this thread.

    Thank you!

    Thread Starter cb831

    (@cb831)

    Exactly what I did ??

    Thanks for the guidance.

    Plugin Support Chatoxz (a11n)

    (@chatoxz)

    Hi there,

    That’s nice to hear; thanks for letting us know. If something else comes up, feel free to reply to this thread.
    ?
    If Jetpack has been helpful to you, please take a moment to leave us a review.?Your feedback not only helps us improve our product but also helps other potential users make informed decisions.

    Have a nice day,

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.