Send Gift Certificate - Your Message Loses 'carriage returns'
It's a simple problem but I don't know the solution! The message entered by someone in the 'Your message' text area when they send a gift certificate loses any new lines:
eg.
Bob
Here is your present
Love Cindy
becomes
Bob Here is your present Love Cindy on both the preview and the final email.
How can I retain the CRLF's/new lines/br's/paras or whatever you want to call them?
Any help greatly appreciated, I've searched high and low for an answer to this. :frusty:
Re: Send Gift Certificate - Your Message Loses 'carriage returns'
In the Catalog ... Option Name Manager ...
On the Option Name for:
Your message
set the
Rows to 5
Maximum length: 500 (or however many characters)
Now the customer can write what they want with enters on the new lines and you will see this on the Order ...
Re: Send Gift Certificate - Your Message Loses 'carriage returns'
Thanks for the reply, understand but unfortunately it's not something I've personally setup (which is what you are pointing to) but a default php files that's used to send a gift certificate as part of the system files
It's the form that creates $EMAIL_MESSAGE_HTML (used by the gv_send email template) from the send gift certifcate page. It strips the returns from the email preview and the actual email when you send it but interestingly if you go to re-edit the email message from the preview page it shows them in the multi line text area.
There is a template 'tpl_gv_send_default.php' used to control how the send gift cert page looks which I guess uses this:
stripslashes($_POST['message']);
to preview the message.
I guess it does something similar somewhere else when it send it which is also getting rid ot the returns.
Am I making any sense?
Re: Send Gift Certificate - Your Message Loses 'carriage returns'
the key I think is in $EMAIL_MESSAGE_HTML
try forcing breaks in HTML format, not by simply hitting enter in the form field
when you want a new line type to space a line use 2 in a row
Code:
ipso lorum est bulldoodoo <br /> Nextus linus overis hereus
<br /><br />The Management
should give you:
ipso lorum est bulldoodoo
Nextus linus overis hereus
The Management
the problem is form data does this sort of thing from the textbox, if you don't manually break it you need some sort of scripting to turn windows carriage returns into HTML linebreaks since the windows /n (new line code) does not auto translate into html breaks. or you could specify in a string processing script to html break the string after x number of characters
Re: Send Gift Certificate - Your Message Loses 'carriage returns'
swag-nyc might want to reconsider that suggestion. Adding <br /> tags will cause your text-only emails to contain <br /> text which is meaningless to recipients.