function create_envelope_recipients_xml($recipients, $role) { $messagexml = ""; if (!$recipients) { return $messagexml; } foreach ($recipients as $object) { $display = $object['display']; $address = $object['address']; $messagexml .= "<recipient>\n"; $messagexml .= "<address>" . $address . "</address>\n"; $messagexml .= "<display>" . make_cdata($display) . "</display>\n"; $messagexml .= "<role>" . $role . "</role>\n"; $messagexml .= "</recipient>\n"; } return $messagexml; }
function make_cdatatag($tagname, $text) { return make_tag($tagname, make_cdata($text)); }
function create_header_recipients_xml($recipientsstring, $role) { $messagexml = ""; if (empty($recipientsstring)) { return $messagexml; } $recipients = explode(',', $recipientsstring); foreach ($recipients as $addressstring) { $addressparts = extract_address_from_string($addressstring); $display = $addressparts['display']; $address = $addressparts['address']; $messagexml .= "<recipient>\n"; $messagexml .= "<address>" . $address . "</address>\n"; $messagexml .= "<display>" . make_cdata($display) . "</display>\n"; $messagexml .= "<role>" . $role . "</role>\n"; $messagexml .= "</recipient>\n"; } return $messagexml; }