Home / Selections / mail

Selections ‐ mail


Description:

Send a mailing to a specified selection of set of selections (Open mails cannot be used).

The following errors can occur:
- Token not present in request.
- Token not in the required format.
- Session does not exist.
- Session has expired.
- The user does not exist.
- No database specified.
- Database parameter not in correct format.
- You are not allowed to access this database.
- The sendtime parameter is not in the right format.
- The sendtime parameter can not be more than 30 minutes in the past.
- The sendtime parameter can not be more than 30 days in the future.
- The mail parameter is required.
- The mail parameter has the wrong format.
- The selected mail does not exist.
- The selected mail is not fully tested.
- The selections parameter is required.
- The selections parameter should be an array.
- Selection %d does not exist.
- Language %d does not exist.
- The name parameter has the wrong format ([a-z0-9 _@-]).

Example:

You should call this function as followed:
- rest/v2/selections/mail?token=TOKEN&database=DATABASE_ID&sendtime=2011-11-22%2017:30&mail=MAIL_ID&selections[]=SELECTION_ID&selections[]=SELECTION_ID&language=LANGUAGE_ID&name=STRING

                require_once 'Rest.php';

                $username = 'my_username';
                $password = 'my_password';
                $database = '999';

                $rest = new Rest($username, $password, $database);
                $result = $rest->call('selections/mail', [
                	'sendtime' => '2011-11-22 17:30',
'mail' => 'MAIL_ID',
'selections' => [
'SELECTION_ID',
'SELECTION_ID'
],
'language' => 'LANGUAGE_ID',
'name' => 'STRING' ], 'GET'); var_dump($result);

Parameters:

The following parameters this method can/should be called with:

key: sendtime
values: String, any value that can be converted by php/strtotime
what: The datetime the mailing should be sent.

key: mail
values: integer, >= 0
what: The mailing you want to send.

key: selections
values: array[integer], an array of integers, count >= 1
what: The selections you want to sent to.

key: language
values: integer, >= 0, not required
what: The language of the mail.

key: direct_plan
values: integer, 1 or 0, not required
what: Send the mailing without a check from Emark (only available if database is set with the option 'customer can choose to let Emark check the mailing')

key: name
values: String, ([a-z0-9 _@-]), not required.
what: The name for the mailing in the statistics.

See:

The following items:
- user/login For the TOKEN.
- user/database For the DATABASE_ID