<!-- Intent: return the text for the English profile of the message.
	-->


<?php
$url = 'http://api.v4.swiftreach.com/api/Messages/Email/Helpers/EmailContentObjectArrayToText/English';
$authToken = '123456';

$jsonString = ' 
		[{ 
		"SpokenLanguage":"English", 
		"Subject":"English Subject", 
		"Body": 
			[{ 
			"$type":"SwiftReach.Swift911.Core.Messages.Email.EMAIL_TEXT_SOURCE_TEXT, SwiftReach.Swift911.Core", 
			"Text":"<p>\n\tThis is the english message.</p>\n", 
			"TextType":0 
			}] 
		},{ 
		"SpokenLanguage":"Spanish", 
		"Subject":"Inglés", 
		"Body": 
			[{ 
			"$type":"SwiftReach.Swift911.Core.Messages.Email.EMAIL_TEXT_SOURCE_TEXT, SwiftReach.Swift911.Core", 
			"Text":"<p>\n\tEste es el mensaje ingl&eacute;s.</p>\n", 
			"TextType":0 
			}] 
		}]';


$headers = array(
    'Content-type: application/json',
    'SwiftAPI-Key: ' . $authToken,
    'Accept: application/json',
    'Expect:'
);
$ch = curl_init();
$args = array(
    CURLOPT_URL => $url,
    CURLOPT_FOLLOWLOCATION => TRUE,
    CURLOPT_RETURNTRANSFER => TRUE,
    CURLOPT_POST => TRUE,
    CURLOPT_POSTFIELDS => $jsonString,
    CURLOPT_HTTPHEADER => $headers,
);
curl_setopt_array($ch, $args);
$res = curl_exec($ch);
$res_data = json_decode($res, true);
print($res_data);
?>


<!-- Example Return Value -->

<p>\n\tThis is the english message.</p>\n