25 function createMailing($name, $subject, $deprecatedParameter =
false, $type =
"regular")
27 $queryParameters = array(
28 'name' => urlencode($name),
29 'subject' => urlencode($subject),
30 'type' => urlencode($type),
33 return $this->
post(
'mailings',
"", $queryParameters);
41 return $this->
get(
'mailings/name/' . urlencode($mailingName));
49 $response = $this->
get(
'mailings/name/' . urlencode($mailingName));
50 return ($response->isSuccess());
58 return $this->
put(
'mailings/' . $mailingId .
'/settings/disableQosChecks');
66 $queryParameters = array();
67 return $this->
put(
'mailings/' . $mailingId .
'/dispatching', $logic, $queryParameters);
75 return $this->
post(
'mailings/' . $mailingId .
'/dispatching/activate',
"");
87 return $this->
delete(
"mailings/".$mailingId.
"/dispatching");
99 return $this->
delete(
"mailings/".$id);
118 function setHTMLContent($mailingId, $html, $doImageGrabbing =
true, $doLinkTracking =
false)
120 $queryParameters = array(
121 'doImageGrabbing' => ($doImageGrabbing == TRUE) ?
"true" :
"false",
122 'doLinkTracking' => ($doLinkTracking == TRUE) ?
"true" :
"false"
124 return $this->
post(
'mailings/' . $mailingId .
'/contents/html', $html, $queryParameters,
"text/html");
141 return $this->
post(
'mailings/' . $mailingId .
'/contents/text', $text, array(),
"text/plain");
157 return $this->
get(
'mailings/' . $mailingId .
'/contents/html', null,
"text/html");
173 return $this->
get(
'mailings/' . $mailingId .
'/contents/text', null,
"text/plain");
190 return $this->
post(
'mailings/' . $mailingId .
'/targetgroupid',
"<targetgroupid>" . $targetGroupId .
"</targetgroupid>");
206 return $this->
get(
'mailings/' . $mailingId .
'/targetgroupid', null);
224 return $this->
post(
'mailings/' . $mailingId .
'/contents/sender',
"<sender>" . $email .
"</sender>");
240 return $this->
get(
'mailings/' . $mailingId .
'/contents/sender');
257 return $this->
post(
'mailings/' . $mailingId .
'/contents/subject',
"<subject>" . $subject .
"</subject>");
273 return $this->
get(
'mailings/' . $mailingId .
'/contents/subject');
290 return $this->
post(
'mailings/' . $mailingId .
'/contents/senderalias',
"<senderalias>" . $senderalias .
"</senderalias>");
307 return $this->
post(
'mailings/' . $mailingId .
'/contents/recipientalias',
"<recipientalias>" . $recipientalias .
"</recipientalias>");
323 return $this->
get(
'mailings/' . $mailingId .
'/settings/replyto');
340 $queryParameters = array(
341 'auto' => ($auto == TRUE) ?
"true" :
"false",
342 'customEmail' => $customEmail
345 return $this->
post(
'mailings/' . $mailingId .
'/settings/replyto', null, $queryParameters);
370 function getMailingsBySchedulingTime($scheduleTime, $beforeSchedulingTime =
true, $fields = array(), $page_index = 1, $page_size = 100, $orderBy =
"id", $order =
"DESC")
372 $queryParameters = array(
373 'page_index' => $page_index,
374 'page_size' => $page_size,
375 'scheduleTime' => urlencode($scheduleTime),
376 'beforeSchedulingTime' => ($beforeSchedulingTime == TRUE) ?
"true" :
"false",
377 'orderBy' => $orderBy,
381 $queryParameters = $this->appendArrayFields($queryParameters,
"fields", $fields);
383 return $this->
get(
'mailings/filter/scheduletime', $queryParameters);
404 $queryParameters = array(
405 'page_index' => $page_index,
406 'page_size' => $page_size,
410 $queryParameters = $this->appendArrayFields($queryParameters,
"types", $types);
411 $queryParameters = $this->appendArrayFields($queryParameters,
"fields", $fields);
413 return $this->
get(
'mailings/filter/types', $queryParameters);
426 return $this->
post(
'mailings/' . $mailingId .
'/sendnow');
444 return $this->
get(
'mailings/' . $mailingId .
'/settings/doi_key', null,
"text/html");
459 return $this->
post(
'mailings/' . $mailingId .
'/settings/doi_key',
"<doi_key>$doiKey</doi_key>");
471 return $this->
delete(
"mailings/${mailingId}/dispatching");
485 return $this->
get(
"mailings/${mailingId}/dispatching");
498 return $this->
get(
"mailings/${mailingId}/schedule");
510 return $this->
get(
"mailings/${mailingId}/archiveurl");
527 return $this->
post(
'mailings/' . $mailingId .
'/name',
"<name>" . $name .
"</name>");
539 return $this->
get(
"mailings/${mailingId}/name");
556 return $this->
post(
'mailings/' . $mailingId .
'/settings/tags',
"<tags>" . join(
"#", $tags) .
"</tags>");
568 return $this->
get(
"mailings/${mailingId}/settings/tags");
585 return $this->
post(
'mailings/' . $mailingId .
'/settings/locale',
"<locale>$locale</locale>");
597 return $this->
get(
"mailings/${mailingId}/settings/locale");
610 return $this->
post(
"mailings/${mailingId}/contents/smartmailing/rss");
622 return $this->
post(
"mailings/${mailingId}/copy");
637 $handle = fopen($filename,
"rb");
638 if (FALSE === $filename) {
642 while (!feof($handle)) {
643 $contents .= fread($handle, 8192);
646 if ($attachmentFileName === null) {
647 $attachmentFileName = basename($filename);
650 return $this->
addAttachment($mailingId, $attachmentFileName, $contentType, $contents);
664 $queryParameters = array(
'filename' => $filename );
665 return $this->
post(
"mailings/${mailingId}/attachments", $contents, $queryParameters, null, null, $contentType, strlen($contents));
675 return $this->
get(
"mailings/${mailingId}/attachments");
686 return $this->
get(
"mailings/${mailingId}/attachments/${attachmentId}");
696 return $this->
get(
"mailings/${mailingId}/attachments/count");
706 return $this->
delete(
"mailings/${mailingId}/attachments/");
721 return $this->
delete(
"mailings/${mailingId}/attachments/${attachmentId}");
732 $queryParameters = array(
'src_mailing_id' => $srcMailingId );
734 return $this->
put(
"mailings/${mailingId}/attachments",
"", $queryParameters);
744 return $this->
get(
"mailings/${mailingId}/settings/properties");
757 $xml =
new SimpleXMLElement(
"<?xml version=\"1.0\"?><properties></properties>");
759 if (is_array($properties)) {
760 foreach ($properties as $property) {
761 $this->sxml_append($xml, $property->toXML());
764 $this->sxml_append($xml, $properties->toXML());
767 return $this->
post(
"mailings/${mailingId}/settings/properties", $xml->asXML());
780 $queryParameters = array(
781 'name' => $property->key,
782 'value' => $property->value
785 return $this->
put(
"mailings/${mailingId}/settings/properties",
"", $queryParameters);
798 $queryParameters = array(
799 'name' => $propertyName,
802 return $this->
delete(
"mailings/${mailingId}/settings/properties", $queryParameters);
805 function sxml_append(SimpleXMLElement $to, SimpleXMLElement $from) {
806 $toDom = dom_import_simplexml($to);
807 $fromDom = dom_import_simplexml($from);
808 $toDom->appendChild($toDom->ownerDocument->importNode($fromDom,
true));
addCustomProperties($mailingId, $properties)
getMailingIdByName($mailingName)
getTriggerDispatchLogic($mailingId)
setTriggerDispatchLogic($mailingId, $logic)
deleteAttachments($mailingId)
getAttachment($mailingId, $attachmentId)
setDoiMailingKey($mailingId, $doiKey)
deleteCustomProperty($mailingId, $propertyName)
setSender($mailingId, $email)
updateCustomProperty($mailingId, $property)
deleteActiveTriggerMailing($mailingId)
getReplyToAddress($mailingId)
setTargetGroupId($mailingId, $targetGroupId)
fillRssSmartContentTags($mailingId)
getArchiveUrl($mailingId)
getTargetGroupId($mailingId)
checkIfMailingExistsByName($mailingName)
getAttachmentsCount($mailingId)
getHTMLContent($mailingId)
getDoiMailingKey($mailingId)
getMailingsByTypes($types, $fields=array(), $page_index=1, $page_size=100)
createMailing($name, $subject, $deprecatedParameter=false, $type="regular")
deactivateTriggerMailing($mailingId)
deleteAttachment($mailingId, $attachmentId)
setName($mailingId, $name)
setSubject($mailingId, $subject)
setSenderAlias($mailingId, $senderalias)
getTextContent($mailingId)
getMailingsBySchedulingTime($scheduleTime, $beforeSchedulingTime=true, $fields=array(), $page_index=1, $page_size=100, $orderBy="id", $order="DESC")
setTextContent($mailingId, $text)
setHTMLContent($mailingId, $html, $doImageGrabbing=true, $doLinkTracking=false)
addAttachment($mailingId, $filename, $contentType, $contents)
getAttachments($mailingId)
disableQosChecks($mailingId)
copyAttachments($mailingId, $srcMailingId)
setLocale($mailingId, $locale)
setRecipientAlias($mailingId, $recipientalias)
setTriggerActive($mailingId)
setTags($mailingId, $tags)
getCustomProperties($mailingId)
addAttachmentFromFile($mailingId, $filename, $contentType, $attachmentFileName=null)
sendMailingNow($mailingId)
post($resourcePath, $payload="", $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null, $contentType=null, $contentLength=null)
setReplyToAddress($mailingId, $auto=true, $customEmail=null)
put($resourcePath, $payload="", $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null)