Download the PHP package comicrelief/smartfocus without Composer
On this page you can find all versions of the php package comicrelief/smartfocus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package smartfocus
PHP SmartFocus API
This is a PHP library for SmartFocus API.
This library provides access to SmartFocus (previously known as EmailVision) Campaign Commander's APIs. It was designed with flexibility in mind, with fully decoupled components, so it would be easy for developer to inject and use his own components where appropriate.
Requirements
- PHP 5.3+
- curl
- libxml
Install
composer require estina/smartfocus
Usage
Interacting with API can be trimmed down to these basic steps:
- open the connection and extract security token from the XML response
- call the API method(s) using token and other required parameters
- close the connection
Please, check the [examples] (#api-examples) below.
HTTP transport to the actual REST interface is implemented in Api\Http\CurlClient class. It's possible to use different class object as long as it implements a very simple Api\Http\ClientInterface.
Supported APIs and Methods
- Member REST - individual subscription management
- Batch Member REST - batch subscription management
- Notification REST - notification (email sending) service
Member REST
- openConnection($server, $login, $password, $key)
- closeConnection($token)
- [insertMemberByEmailAddress($token, $email)] (#memberinsertmemberbyemailaddresstoken-email)
- insertMember($token, $xml)
- updateMember($token, $xml)
- [insertOrUpdateMember($token, $xml)] (#memberinsertorupdatemembertoken-xml)
- updateMemberByEmailAddress($token, $email, $field, $value)
- getMemberJobStatus($token, $jobId)
- getMemberByEmail($token, $email)
- getMemberByCellphone($token, $cellphone)
- getMemberById($token, $memberId)
- getMembersByPage($token, $page)
- getMembersByCriteria($token, $xml)
- getMemberTableColumnNames($token)
- unsubscribeMemberByEmail($token, $email)
- unsubscribeMemberByCellphone($token, $cellphone)
- unsubscribeMemberById($token, $memberId)
- unsubscribeMemberByValue($token, $xml)
- resubscribeMemberByEmail($token, $email)
- resubscribeMemberByCellphone($token, $cellphone)
- resubscribeMemberById($token, $memberId)
Batch Member REST
- openConnection($server, $login, $password, $key)
- closeConnection($token)
- buildInsertXml($filepath, $dateformat = 'yyyy-MM-dd', $dedup = true)
- insert($token, $xml)
- buildUpdateXml($filepath, $dateformat = 'yyyy-MM-dd')
- update($token, $xml)
- getLastUpload($token)
- getUploadStatus($token, $uploadId)
- getUploads($token, $page, $pageSize = 1000, $sort = null, $status = null, $source = null)
- getLogFile($token, $uploadId)
- getBadFile($token, $uploadId)
Notification REST
- [send($email, $encrypt, $notificationId, $random, $dyn, $senddate, $uidkey, $stype)] (#notificationsendemail-encrypt-notificationid-random-dyn-senddate-uidkey-stype)
- buildTransactionalRequestObject($recipientEmail, $encryptId, $randomId, $dyn, $content, $enableTracking, $additionalParams)
- post(SimpleXMLElement $xmlRequestObject)
API Examples
Member::insertMemberByEmailAddress($token, $email)
Member::insertOrUpdateMember($token, $xml)
Notification::send($email, $encrypt, $notificationId, $random, $dyn, $senddate, $uidkey, $stype)
Notification::post(SimpleXMLElement $xmlRequestObject)
Troubleshooting
If you get the response with the following status codes:
- UPDATE_MEMBER_FAILED
- ISTUPD_MEMBER_FAILED
Check the following:
- XML input body is formatted correctly
- There are no spaces, newlines or other invalid symbols inside the
tag, it should look like:
Unit test
composer test
More information
SmartFocus documentation is available in the "doc" folder. Also, more detailed descriptions of all functions and their parameters are available in the source code.
All versions of smartfocus with dependencies
ext-curl Version *