![]() |
Maileon PHP client
1.5.0
Easily integrate your PHP application with Maileon.
|
Public Member Functions | |
createContact ($contact, $syncMode, $src="", $subscriptionPage="", $doi=FALSE, $doiPlus=FALSE, $doiMailingKey="") | |
createContactByExternalId ($contact, $syncMode, $src="", $subscriptionPage="", $doi=FALSE, $doiPlus=FALSE, $doiMailingKey="") | |
getContact ($contactId, $checksum, $standard_fields=array(), $custom_fields=array(), $ignoreChecksum=false) | |
getContactsCount () | |
getContacts ($page_index=1, $page_size=100, $standard_fields=array(), $custom_fields=array()) | |
getContactByEmail ($email, $standard_fields=array(), $custom_fields=array()) | |
getContactsByEmail ($email, $standard_fields=array(), $custom_fields=array()) | |
getContactsByExternalId ($externalId, $standard_fields=array(), $custom_fields=array()) | |
getContactsByFilterId ($filterId, $page_index=1, $page_size=100, $standard_fields=array(), $custom_fields=array()) | |
getCountContactsByFilterId ($filterId) | |
getCountActiveContactsByFilterId ($filterId) | |
updateContact ($contact, $checksum="", $src=null, $subscriptionPage=null, $triggerDoi=FALSE, $doiMailingKey=null, $ignoreChecksum=false) | |
synchronizeContacts ($contacts, $permission=null, $syncMode=null, $useExternalId=false, $ignoreInvalidContacts=false, $reimportUnsubscribedContacts=true, $overridePermission=true, $updateOnly=false, $preferMaileonId=false) | |
unsubscribeContactByEmail ($email, $mailingId="", $reasons=null, $nlAccountIds=array()) | |
addUnsubscriptionReasonsToUnsubscribedContact ($id, $checksum=null, $reasons=null, $ignore_checksum=false) | |
unsubscribeContactById ($id, $mailingId="", $reasons=null) | |
unsubscribeContactByExternalId ($externalId, $mailingId="", $reasons=null) | |
unsubscribeContactByExternalIdFromMultipleAccounts ($externalId, $nlAccountIds=array()) | |
getBlockedContacts ($standardFields=array(), $customFields=array(), $pageIndex=1, $pageSize=1000) | |
deleteContact ($id) | |
deleteContactByEmail ($email) | |
deleteContactsByExternalId ($externalId) | |
deleteAllContacts ($authorized="no") | |
createCustomField ($name, $type= 'string') | |
getCustomFields () | |
renameCustomField ($oldName, $newName) | |
deleteCustomField ($name) | |
deleteStandardFieldValues ($name) | |
deleteCustomFieldValues ($name) | |
![]() | |
__construct (array $config) | |
setDebug ($isDebug) | |
isDebug () | |
get ($resourcePath, $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null) | |
put ($resourcePath, $payload="", $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null) | |
post ($resourcePath, $payload="", $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null, $contentType=null, $contentLength=null) | |
delete ($resourcePath, $queryParameters=array(), $mimeType= 'application/vnd.maileon.api+xml', $deserializationType=null) | |
Additional Inherited Members | |
![]() | |
static | $MAILEON_XML_MIME_TYPE = 'application/vnd.maileon.api+xml' |
![]() | |
appendArrayFields ($params, $name, $fieldValues) | |
![]() | |
$configuration | |
$encodedApiKey | |
$debug = false | |
$throwException = true | |
$proxy_host | |
$proxy_port = 80 | |
$timeout | |
This service wrapps the REST API calls for the contact features.
Definition at line 9 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::createContact | ( | $contact, | |
$syncMode, | |||
$src = "" , |
|||
$subscriptionPage = "" , |
|||
$doi = FALSE , |
|||
$doiPlus = FALSE , |
|||
$doiMailingKey = "" |
|||
) |
Creates or updates a contact and optionally triggers a double opt-in (doi) process. Note that none of the attributes is required.
com_maileon_api_contacts_Contact | $contact | the contact to create or update; if no permission is set, the Maileon default permission "NONE" will be used |
com_maileon_api_contacts_SynchronizationMode | $syncMode | the synchronization mode to employ |
string | $src | A string intended to describe the source of the contact. If provided, the string will be stored with the doi process. |
string | $subscriptionPage | In case where this method was called by a subscription page, this string offers the possibility to keep track of it for use in reports. |
bool | $doi | Tells whether a double opt-in process should be started for the created contact. Note that the status code returned for this request does not mean that the doi process succeeded. |
bool | $doiPlus | This parameter is ignored if doi is not provided or false. In case the doi process succeeds, Maileon will be allowed to track opens and clicks of the contact. |
string | $doiMailingKey | This parameter is ignored if doi is not provided or false. References the doi mailing to be used. If not provided, the default doi mailing will be used. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 41 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::createContactByExternalId | ( | $contact, | |
$syncMode, | |||
$src = "" , |
|||
$subscriptionPage = "" , |
|||
$doi = FALSE , |
|||
$doiPlus = FALSE , |
|||
$doiMailingKey = "" |
|||
) |
Creates or updates a contact based on the external ID and optionally triggers a double opt-in (doi) process. Note that none of the attributes is required. Also note: this call returns 409 Conflict if more then one contact with the given external ID exists as it is impossible to determine the correct contact to update.
com_maileon_api_contacts_Contact | $contact | the contact to create or update |
com_maileon_api_contacts_SynchronizationMode | $syncMode | the synchronization mode to employ |
string | $src | A string intended to describe the source of the contact. If provided, the string will be stored with the doi process. |
string | $subscriptionPage | In case where this method was called by a subscription page, this string offers the possibility to keep track of it for use in reports. |
bool | $doi | Tells whether a double opt-in process should be started for the created contact. Note that the status code returned for this request does not mean that the doi process succeeded. |
bool | $doiPlus | This parameter is ignored if doi is not provided or false. In case the doi process succeeds, Maileon will be allowed to track opens and clicks of the contact. |
string | $doiMailingKey | This parameter is ignored if doi is not provided or false. References the doi mailing to be used. If not provided, the default doi mailing will be used. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 99 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getContact | ( | $contactId, | |
$checksum, | |||
$standard_fields = array() , |
|||
$custom_fields = array() , |
|||
$ignoreChecksum = false |
|||
) |
Return a contact using the maileon contact id. This resource is intended to be used in profile update pages to prefill profile update forms. In order to prevent form fields manipulation, a checksum of the maileon contact id is required as parameter. Please refer to the documentation of the profile update pages for more details about how to get the maileon contact id and the corresponding checksum.
string | $contactId | the maileon contact id |
string | $checksum | the checksum of the maileon contact id |
string[] | $standard_fields the standard fields to retrieve with the contact | |
string[] | $custom_fields the custom fields to retrieve with the contact | |
bool | $ignoreChecksum | if set to true, no checksum is required |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 141 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getContactsCount | ( | ) |
This method returns the number of contacts in the maileon newsletter account.
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 164 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getContacts | ( | $page_index = 1 , |
|
$page_size = 100 , |
|||
$standard_fields = array() , |
|||
$custom_fields = array() |
|||
) |
Returns a page of contacts in the account.
number | $page_index | the index of the result page to fetch |
number | $page_size | the number of results to fetch per page |
string[] | $standard_fields the standard fields to retrieve for the contacts | |
string[] | $custom_fields the custom fields to retrieve for the contacts |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 186 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getContactByEmail | ( | $email, | |
$standard_fields = array() , |
|||
$custom_fields = array() |
|||
) |
Returns a contact with the provided email address.
string | the email address to retrieve a contact for | |
string[] | $standard_fields the standard fields to return with the contact | |
string[] | $custom_fields the custom fields to return with the contact |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 214 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getContactsByEmail | ( | $email, | |
$standard_fields = array() , |
|||
$custom_fields = array() |
|||
) |
Returns a list of contacts with the provided email address.
string | the email address to retrieve a contact for | |
string[] | $standard_fields the standard fields to return with the contact | |
string[] | $custom_fields the custom fields to return with the contact |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 240 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getContactsByExternalId | ( | $externalId, | |
$standard_fields = array() , |
|||
$custom_fields = array() |
|||
) |
Retrieves all contacts with a given external ID.
string | $externalId | the external ID to search for |
string[] | $standard_fields | |
string[] | $custom_fields |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 263 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getContactsByFilterId | ( | $filterId, | |
$page_index = 1 , |
|||
$page_size = 100 , |
|||
$standard_fields = array() , |
|||
$custom_fields = array() |
|||
) |
Retrieves all contacts with a given contact filter ID.
string | $filterId | the filter ID to use to select contacts |
string[] | $standard_fields | |
string[] | $custom_fields |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 286 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getCountContactsByFilterId | ( | $filterId | ) |
Retrieves the number of contacts matching a given contact filter ID.
string | $filterId | the filter ID to use to select contacts |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 307 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getCountActiveContactsByFilterId | ( | $filterId | ) |
Retrieves the number of active contacts matching a given contact filter ID.
string | $filterId | the filter ID to use to select contacts |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 322 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::updateContact | ( | $contact, | |
$checksum = "" , |
|||
$src = null , |
|||
$subscriptionPage = null , |
|||
$triggerDoi = FALSE , |
|||
$doiMailingKey = null , |
|||
$ignoreChecksum = false |
|||
) |
This methods updates the data of a Maileon contact identifying a contact by its internal Maileon ID
com_maileon_api_contacts_Contact | $contact | The contact object to send to Maileon. |
string | $checksum | This is the checksum that must be used when the request comes from a user, see documentation under http://dev.maileon.com for details. |
string | $src | The source that shall be passed to the API. |
string | $subscriptionPage | The subscription page the request comes from. |
boolean | $triggerDoi | If true, a DOI mailing will be triggered. |
string | $doiMailingKey | If this parameter is set, the DOI mailing with the given ID will be triggered. If not set, the default DOI Mailing will be triggered. |
string | $ignoreChecksum | If this is true, the checksum will not be validated. This is only valid if the request is NOT triggered by the contact (e.g. on a profile change landing page) but from a third party system. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 349 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::synchronizeContacts | ( | $contacts, | |
$permission = null , |
|||
$syncMode = null , |
|||
$useExternalId = false , |
|||
$ignoreInvalidContacts = false , |
|||
$reimportUnsubscribedContacts = true , |
|||
$overridePermission = true , |
|||
$updateOnly = false , |
|||
$preferMaileonId = false |
|||
) |
Synchronizes a list of contacts with the contacts in the account and returns a detailed report with stats and validation errors.
com_maileon_api_contacts_Contacts | $contacts | the contacts to synchronize |
com_maileon_api_contacts_Permission | $permission | the permission to set for the contacts |
com_maileon_api_contacts_SynchronizationMode | $syncMode | the sync mode to use |
string | $useExternalId | if set to true, the external id is used as identifier for the contacts. Otherwise the email address is used as identifier. |
string | $ignoreInvalidContacts | if set to true, invalid contacts are ignored and the synchronization succeeds for valid contacts. |
string | $reimportUnsubscribedContacts | if set to true, unsubscribed contacts will be imported, if false, they will be ommitted |
boolean | $overridePermission | if set to true the permission of existing and non existing contacts will be overwridden, if false, the permission will be used for new contacts only and existing contacts will not be influenced. |
boolean | $updateOnly | If true, only existing contacts are updated and no new contacts are created |
boolean | $preferMaileonId | If true, Maileon tries identifying contacts by Maileon-ID, if available. Fallback is always the email address. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 401 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::unsubscribeContactByEmail | ( | $email, | |
$mailingId = "" , |
|||
$reasons = null , |
|||
$nlAccountIds = array() |
|||
) |
This method unsubscribes a contact from Maileon using the contact's email adress.
string | The email address of the contact. | |
long | $mailingId | The ID of the mailing to assign the unsubscribe to. the mailing must have been sent, i.e. be sealed. |
array | $reasons | an array of reasons or a single reason (string). Unsubscription reasons have two layers of information, see http://dev.maileon.com/api/rest-api-1-0/contacts/unsubscribe-contacts-by-email for more details about the format. The parameter(s) will be url-encoded by the client, you do not need to provide urlencoded strings. |
array | $nlAccounts | Optional parameter to define in which accounts the email should be unsubscribed. Note: The accounts must belong to the owner of the API key in use, otherwise they will be ignored. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 437 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::addUnsubscriptionReasonsToUnsubscribedContact | ( | $id, | |
$checksum = null , |
|||
$reasons = null , |
|||
$ignore_checksum = false |
|||
) |
This method adds unsubscription reasons to an unsubscribed contact. The contact must already be unsubscribed, otherwise 400 will be returned by the PAI
int | $id | The ID of the contact. |
string | $checksum | The checksum generated by Maileon |
array | $reasons | an array of reasons or a single reason (string). Unsubscription reasons have two layers of information, see http://dev.maileon.com/api/rest-api-1-0/contacts/unsubscribe-contacts-by-email for more details about the format. The parameter(s) will be url-encoded by the client, you do not need to provide urlencoded strings. |
boolean | $ignore_checksum | If the call comes from an authorized system instead of the user you might ignore the checksum |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 481 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::unsubscribeContactById | ( | $id, | |
$mailingId = "" , |
|||
$reasons = null |
|||
) |
This method unsubscribes a contact from Maileon using the Maileon id.
int | $id | |
long | $mailingId | The ID of the mailing to assign the unsubscribe to. the mailing must have been sent, i.e. be sealed. |
array | $reasons | an array of reasons or a single reason (string). Unsubscription reasons have two layers of information, see http://dev.maileon.com/api/rest-api-1-0/contacts/unsubscribe-contacts-by-maileon-id for more details about the format. The parameter(s) will be url-encoded by the client, you do not need to provide urlencoded strings. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 514 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::unsubscribeContactByExternalId | ( | $externalId, | |
$mailingId = "" , |
|||
$reasons = null |
|||
) |
This method unsubscribes a contact from Maileon using the external id.
string | $externalId | The external ID of the contact. |
long | $mailingId | The ID of the mailing to assign the unsubscribe to. the mailing must have been sent, i.e. be sealed. |
array | $reasons | an array of reasons or a single reason (string). Unsubscription reasons have two layers of information, see http://dev.maileon.com/api/rest-api-1-0/contacts/unsubscribe-contacts-external-id for more details about the format. The parameter(s) will be url-encoded by the client, you do not need to provide urlencoded strings. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 547 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::unsubscribeContactByExternalIdFromMultipleAccounts | ( | $externalId, | |
$nlAccountIds = array() |
|||
) |
This method unsubscribes a contact from Maileon from several accounts (owner of API key must also be the same customer owning the other accounts).
int | $externalId | |
long | $nlaccountid | The ID of the mailing to assign the unsubscribe to. the mailing must have been sent, i.e. be sealed. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 576 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getBlockedContacts | ( | $standardFields = array() , |
|
$customFields = array() , |
|||
$pageIndex = 1 , |
|||
$pageSize = 1000 |
|||
) |
Returns a page of blocked contacts. Blocked contacts are contacts with available permission but that are blocked for sendouts because of blacklist matches or similar reasons such as bounce policy.
string[] | $standardFields the standard fields to select | |
string[] | $customFields the custom fields to select | |
number | $pageIndex | the paging index of the page to retrieve |
number | $pageSize | the number of results per page |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurredntacts_Contacts available at com_maileon_api_MaileonAPIResult::getResult() |
Definition at line 606 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::deleteContact | ( | $id | ) |
This method removes a contact completely from Maileon using the maileon ID. WARNING: the contact is COMPLETELY removed, not only unsubscribed. This means that not only the contact data is removed but also all statistics change. For most usecases the unsubscribe method is more appropriate.
string | The email address of the contact to delete. Does not need to be unique. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 630 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::deleteContactByEmail | ( | ) |
This method removes all contacts completely from Maileon using the email address. WARNING: the contacts are COMPLETELY removed, not only unsubscribed. This means that not only the contact data is removed but also all statistics change. For most usecases the unsubscribe method is more appropriate.
string | The email address of the contact to delete. Does not need to be unique. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 647 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::deleteContactsByExternalId | ( | $externalId | ) |
This method removes the contacts completely from Maileon using the external id. WARNING: the contacts are COMPLETELY removed, not only unsubscribed. This means that not only the contact data is removed but also all statistics change. For most usecases the unsubscribe method is more appropriate.
string | $external | ID The external ID of the contact to delete. Does not need to be unique. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 663 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::deleteAllContacts | ( | $authorized = "no" | ) |
This method DELETES ALL CONTACTS. Never ever call this unless you'd prefer a career change anyway.
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 677 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::createCustomField | ( | $name, | |
$type = 'string' |
|||
) |
Creates a custom contact field with the provided name and data type.
string | $name | the name of the new field |
string | $type | the type of the new field. Valid values are 'string', 'integer', 'float', 'date' or 'boolean'. |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 698 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::getCustomFields | ( | ) |
Returns the custom contact fields defined in the account.
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 714 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::renameCustomField | ( | $oldName, | |
$newName | |||
) |
Renames a custom contact field. The data type and the recorded values for the contacts remain unchanged.
string | $oldName | the current name of the field |
string | $newName | the new name of the field |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 732 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::deleteCustomField | ( | $name | ) |
Deletes the custom contact field with the provided name. Note that all the values of the field get auotmatically deleted by this call.
string | $name | the name of the field to delete |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 750 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::deleteStandardFieldValues | ( | $name | ) |
Deletes the values of the given standard contact field for all contacts.
string | $name | the name of the field whose values to delete |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 766 of file ContactsService.php.
com_maileon_api_contacts_ContactsService::deleteCustomFieldValues | ( | $name | ) |
Deletes the values of the given custom contact field for all contacts.
string | $name | the name of the field whose values to delete |
com_maileon_api_MaileonAPIException | if there was a connection problem or a server error occurred |
Definition at line 782 of file ContactsService.php.