We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

tip on doing line breaks for outbound SMS messages

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

tip on doing line breaks for outbound SMS messages

Post by support »

Hi,

If you're looking to set up line breaks for your outbound SMS API, you can use the following PHP code sample as reference:

queuesms.php:

Code: Select all

<?php
header("Content-type: text/xml");

$params['to'] = "19998881234";
$params['from'] = "2435678910";
$params['body'] = "This is a notification.\n\nPlease check your e-mail when you come back.";

// initialize curl
$ch = curl_init();

// set necessary curl options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, "http://hosting.plumgroup.com/ws/sms/queue.xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");

echo(curl_exec($ch));

curl_close($ch);
?>
This would display the text message as:
This is a notification.

Please check your e-mail when you come back.
Regards,
Plum Support

Post Reply