Campaign Commander Member class
Possible Methods
- __construct
- fromLongXML
- toLongXML
- setTimeOut
- setUserAgent
- closeApiConnection
- descMemberTable
- getMemberByEmail
- getMemberById
- getListMembersByObj
- getListMembersByPage
- insertMember
- updateMember
- insertOrUpdateMemberByObj
- updateMemberByObj
- getMemberJobStatus
- unjoinMemberByEmail
- unjoinMemberById
- unjoinMemberByObj
- rejoinMemberByEmail
- rejoinMemberById
__construct
Default constructor
Parameters
- login string
- Login provided for API access.
- password string
- The password.
- key string
- Manager Key copied from the CCMD web application.
- server string (optional)
- The server to use. Ask your account-manager.
Return
void
fromLongXML
Convert a long into a string
Parameters
- value string
- The value to convert.
Return
string
toLongXML
Convert a x into a long
Parameters
- value string
- The value to convert.
Return
string
setTimeOut
Set the timeout
After this time the request will stop. You should handle any errors triggered by this.
Parameters
- seconds int
- The timeout in seconds.
Return
void
setUserAgent
Set the user-agent for you application
It will be appended to ours, the result will look like: "PHP Campaign Commander Member/<version> <your-user-agent>"
Parameters
- userAgent string
- Your user-agent, it should look like <app-name>/<app-version>.
Return
void
closeApiConnection
Close the connection
Return
bool true if the connection was closes, otherwise false.
descMemberTable
Retrieves the list of fields (i.e. database column names) available in the Member table.
Return
array An array containing all database column names.
getMemberByEmail
Get a member by email-address
Parameters
- email string
- The email address of the member to retrieve.
Return
array An array with all fields as a key-value-pair for the member.
getMemberById
Uses the member ID to retrieve the details of a member.
Parameters
- id string
- The ID of the member whose details you want to retrieve..
Return
array An array with all fields as a key-value-pair for the member.
getListMembersByObj
Retrieves a list of a maximum of 50 members who match the given criteria.
Parameters
- member array
- The member object containing the criteria.
Return
array An array containing the list of members who match the criteria.
getListMembersByPage
Retrieves all members page by page. Each page contains 10 members.
Parameters
- page int
- The page number to retrieve.
Return
array An array containing the list of members.
insertMember
Insert a new member, all member-fields will be empty
Parameters
- email string
- The email addres of the new member.
Return
string The job ID of the insertion, see getJobStatus().
updateMember
Updates a given field for a certain user
Parameters
- email string
- The email address of the member.
- field string
- The field to update.
- value mixed
- The value with which to update the field.
Return
string The job ID of the update, see getJobStatus().
insertOrUpdateMemberByObj
Insert a new member of updates an existing member
Parameters
- fields array
- The fields, as a key-value-pair, that will be updates/inserted.
- email string (optional)
- The email of the member to update/insert.
- id string (optional)
- The id of the member to update/insert.
Return
string The job ID of the update/insertion, see getJobStatus().
updateMemberByObj
Update a member by building a member-object
Parameters
- fields array
- The fields, as a key-value-pair, that will be set.
- email string (optional)
- The email of the member to update.
- id string (optional)
- The id of the member to update.
Return
string The job ID of the update, see getJobStatus().
getMemberJobStatus
Retrieves the job status (i.e. the status of the member insertion or update) using the job ID.
Possible return-values are:
- Insert: The jobs is busy (I think)
- Processing: The job is busy
- Processed: The job was processed and is done
- Error: Something went wrong, there is no way to see what went wrong.
- Job_Done_Or_Does_Not_Exist: the job is done or doesn't exists (anymore).
Parameters
- id string
- The job ID.
Return
string The status of the job.
unjoinMemberByEmail
Unsubscribes one or more members who match a given email address.
Parameters
- email string
- The email address.
Return
string The job ID of the unjoin, see getJobStatus().
unjoinMemberById
Unsubscribes a member who matches a given ID.
Parameters
- id int
- The ID of the member.
Return
string The job ID of the unjoin, see getJobStatus().
unjoinMemberByObj
Unsubscribes a member by object.
Parameters
- member array
- The member.
Return
string The job ID of the unjoin, see getJobStatus().
rejoinMemberByEmail
Re-subscribes an unsubscribed member using his/her email address. If there are multiple members with the same email address, they will all be re-subscribed.
REMARK: The number of rejoins per day is limited to avoid massive rejoins and illegal usage of this method.
Parameters
- email string
- The email address of the member.
Return
string The job ID of the rejoin, see getJobStatus().
rejoinMemberById
Re-subscribes an unsibscribed member using his/her ID.
REMARK: The number of rejoins per day is limited to avoid massive rejoins and illegal usage of this method.
Parameters
- id string
- The ID of the member.
Return
string The job ID of the rejoin, see getJobStatus().