How to add <br> in mail section of WordPress CF7 - wordpress

I'm trying to get line breaks to properly display in the e-mails that the CF7 plugin generates. I am basically trying to dynamically generate a list of items to send through mail, based on what the user checks off on the front end. I am storing that list as a text string with <br> tags in a CF7 hidden input.
So, for example, the idea is to get a string like the following into the hidden input, and then display line breaks in mail:
item 1 <br>
item 2 <br>
item 3 <br>
And so on...and then the hidden input becomes like this
<input type="hidden" val="item 1 <br> item 2 <br> item 3 <br>">
However, when I receive the e-mail, I just see the "<br>" tags in plain text, but I need that to actually be line breaks. I tried checking the option to display the email in HTML format within the plugin's mail settings.

You must check the "Use HTML content type" box below the Message Body field.
Alternatively, just start a new line without the <br> tag, that works in most instances.

Related

How to add pre-made text to a form with a button click from another page? Wordpress Elementor

I have a home accomodation website and it has a page with all the rooms and another one with contact info and email form. The page with rooms has a "Book" button under every room. My idea was that when the "Book" button is pushed than the wepage automatically goes to the Contact page and room info is submitted to the email form. For example when i press the Book button under 3-people bedroom than the text "The client likes to book 3-people bedroom" is added to the email form. I am using Wordpress and Elementor builder for my page and Formidable for form.
I think you could even do this simpler then the suggestion of Umair by indeed adding a parameter to the url. But then istead of using the echo, you can easily retrieve the values by adding the following code as default value in the form [get param=parameter]
So in your example you would create three buttons with following url
https://example.org/contact?room=room1
https://example.org/contact?room=room2
https://example.org/contact?room=room3
On your contact form choose the field in which you want to show the text and add as default value
[get param=room].
Obviously you can change the text after the parameter 'room=' in whatever you want.
Hi Yes you need to add a get request url (https://testdomain.com/formpage/?formtext=formtitle) of this button so when the user click on the button it will redirect with the get request url like this https://testdomain.com/formpage/?formtext=formtitle
then you can add this variable echo where ever you want to display this text also in the fomidable form also have this variable option to place in form.
so your form will be display with the selected text by default.
if( $_GET["formtext"]){
echo $_GET["formtext"];
}

How can I copy rich text (with html tags)?

I am using a rich text editor (ckEditor) in my Angular 7 app. I now want an action button to copy the text entered in that editor to the clipboard, but via ngx-clipboard the html tags are literally in the text copied. How can I have the tags applied?
I don't know how to accomplish this. ngx-clipboard is third party. I have tried other examples making a custom directive, but got stuck on that.
This is how I call ngxClipboard:
<button mat-button ngxClipboard [cbContent]="document._source.response" matTooltip="Copy response" matTooltipPosition="above"><img src="https://img.icons8.com/material/24/000000/copy--v1.png"></button>
The content on the clipboard looks like this:
<p>This is the copied text. It contains html tags</p>

Contact form 7 WordPress plugin not showing last name on my email that I've received

I would like to set my contact form 7 to have the first and last name. But I cannot figure out how to set the last name.
The first name:
<label> First Name (required) [text* your-name] </label>
But what about the last name?
I've tried something like your-last-name, last-name, default:user_last_name, your_last_name etc.. but still have no luck.
Any help will be appreciated!
Based on your feedback, you need to update the "Mail" tab of the form to include any new field that you add. See the image below:
You can try the following in your Mail tab:
You have a new enquiry:
First Name: [your-name]
Last Name: [last-name]
Email Address: [your-email]
This will then show the values in the body of the email you receive. See the below example:
Please click the 'Mail' tab just in the side of 'Form' tab.
Find the [last-name] tag which you have written in the form <label> Last Name (required) [text* last-name] </label> and place that tag where you want to be displayed in the mail, as described in the image above.

WP Conctact from 7 hook - add additional mail is chekbox in form is checked (wpc7)

I have Contact Form 7 in my WordPress. The form has two text boxes and one checkbox. How can I send a copy of the letter, if chekbok selected? Perhaps there is a hook, which allows you to do this?
I believe you can accomplish this by editing the form tag, of course in your case you would edit the checkbox form tag and not the select form tag shown below :
[select your-recipient "CEO|ceo#example.com"
"Sales|sales#example.com"
"Support|support#example.com"]
and then editing your mail tag like so:
[_raw_{field name}] ([_raw_your-recipient]
For a more in depth explanation check out this link: https://contactform7.com/selectable-recipient-with-pipes/

how to put the node:link token in the html a label?

i have installed the views and token module. i add a views field 'Node:Link' and check the 'exclude from display' option for the 'node:link' field and set the field first in the field order,now i want to overrite a views field.
i put this more >> in the rewrite the output of this field text box. but it can't work? [view_node] is the Node:Link token, how to make the more>> link ok? thank you
In the Node:Link field, enter more in Text to display: text box.
No need to put anchor tag just type [view_node] in the rewrite the output of this field text box.
Views has a built in way to make text link to other pages with tokens. I would use that instead of putting the anchor tag in the rewrite section. It's titled, "Output this field as a link"
If you're on Drupal 6 and you just want to link the field to it's node then just check the box "Link this field to it's node"

Resources