Skip Navigation

[Resolved] Can't fint 'Text Mode' in the notification to create a HTML e-mail confirmation

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by roulartaM 5 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1356645
cred-user-email-confirmation-form.png

Hi there!

I want to ask another question about this topic: https://toolset.com/forums/topic/how-to-style-a-user-form-notification-e-mail-body-with-header-css/#bbp-new-topic
I've read the webpage provided in the solution (https://toolset.com/forums/topic/cred-email-notification-template-looks-broken-even-though-tested-in-litmus/#post-595280) and saw there should be a 'Text mode' in e-mail body confirmation (user form CRED).

Unfortunately, I can't see that text-mode button in my installation. See screenshot.
Am I missing something or did I misunderstood the solution? 🙂

#1356885

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I didn't find the replies in the linked forum threads very helpful.

Note that when you set up a notification for a Toolset Form, you are only editing the email body. You cannot directly edit the email head, so adding doctype declarations that belong in the head are meaningless.

You cannot link to external stylesheets, and should include the styles for your emails within the body, inside style tags.

The problem is that Forms automatically adds p tags to the notification body. I've tried to find a way to disable them, but cannot.

There is a shortcode you can use to not add auto paragraphs, namely wpv-noautop. Wrapping the entire notification with that shortcode prevents p tags being added automatically within, but the entire notification body is still added inside one single p tag.

So my workaround is to being the notification by closing that p tag, then using the wpv-noautop shortcode to prevent the auto-paragraphs, and at the very end opening a new p tag (because the notification will be followed by a closing p tag).

So I'm able to add styling to the notifications like so:

</p>
[wpv-noautop]
<style type="text/css">
  .red {
    color: red;
  }
</style>
<p class="red">New thing submitted.</p>
<p class="not-red">This looks like an HTML editor but uses auto-paragraphs.</p>
[/wpv-noautop]
I can still use paragraphs outside the wpv-noautop shortcode.

So this will be on a new line.
<p>
#1357985
emailonacid.png

Thanks for your reply Nigel!

I've tested the code in 'Email on acid' and it works for many clients. BUT it's not working when you view those styled mails in gmail (very important client). See hidden link (bullet 4) and screenshot.

is there a way to adjust the <head> and <body> of that HTML mail via functions.php?

#1358109

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

In that case I think you are going to have to limit yourself to inline styles (which I believe is the safest technique for cross-client compatibility in any case).

So more like...

</p>
[wpv-noautop]
<p style="color: red">New thing submitted.</p>
<p style="color: yellow">This looks like an HTML editor but uses auto-paragraphs.</p>
[/wpv-noautop]
I can still use paragraphs outside the wpv-noautop shortcode.
 
So this will be on a new line.
<p>

I have created an internal request to have an option to disable auto-paragraphs on the notification body, but until that is implemented I don't believe you can include a full HTML document as the body (with doctype declaration, head and body) because it is not possible to start with at least one p tag and the doctype declaration would need to be the very first line.

You could try it and see, but email clients tend to be very particular and while it might work in some clients I imagine it could break others.

#1358605

Thank's for creating the internal request, I do appreciate it!
For now, I'll set up a non-responsive e-mail. It is what it is 😉