How to I add line breaks in AddMemberMessageRTQ?
Find the answer to your question
Advanced Search
Products
Question
I try and submit extra line breaks with AddMemberMessageRTQ (or related calls). The API seems to "eat" the "extra" line breaks. How I can send a message that is spaced correctly? I want this: Hello Customer, Have a nice day! - The Seller and not: Hello Customer, Have a nice day, - The Seller
Answer
To add the line breaks, you can use encoded characters in the message you're sending. A hex-encoded character looks like this: where '13' is the decimal ASCII character code you want to output in the message. You can get a list of ASCII characters at http://www.asciitable.com/.
The characters you're interested in are and , which are a 'linefeed' and 'carriage return' character, respectively. These two characters are written to an application whenever you press the 'enter' key. This is what causes the cursor to go to the next line.
However, using these characters doesn't get around the problem illustrated in the solution. If you want to prevent the API from 'eating' the 'extra' line break, you need to put a character in between the first line break and the second. One character you can use is a space. With that in mind, let's see what text you would send to get the following message:
Message to the customerDear Valued Customer,
Thanks for your interest in our product. We will get back to you soon.
Sincerely,
The Seller
Note the space between and the following 
. If you omit this space, the extra line break will be removed when the API call is made, and your message won't look like you expect.
You can get a similar effect without resorting to the encoded characters as well. If you type the body like you want it, and make sure to add a space on the blank lines, you can achieve the formatting you want as well.
Formatted Message without Encoded CharactersDear Valued Customer,
(a space character is on this 'blank' line)
Thanks for your interest in our product. We will get back to you soon.
(a space character is on this 'blank' line)
Sincerely,
The Seller