Send a transactional email
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.
You should call this function as followed:
- rest/v2/subscriber/sendtransactional?token=TOKEN&database=DATABASE_ID&mail=MAIL_ID&id=SUBSCRIBER_ID&sysname=stringular
&search[]=FIELD_NAME&search[]=FIELD_NAME&replace[]=REPLACE_VALUE&replace[]=REPLACE_VALUE
require_once 'Rest.php';
$username = 'my_username';
$password = 'my_password';
$database = '999';
$rest = new Rest($username, $password, $database);
$result = $rest->call('subscriber/sendTransactional', [
'mail' => 'MAIL_ID',
'id' => 'SUBSCRIBER_ID',
'sysname' => 'stringular',
'search' => [
'FIELD_NAME',
'FIELD_NAME'
],
'replace' => [
'REPLACE_VALUE',
'REPLACE_VALUE'
]
], 'GET');
var_dump($result);
The following parameters this method can/should be called with:
key: mail
values: integer, required
what: The ID of the mail
key: subscriber
values: integer, required
what: The ID of the subscriber
key: sysname
values: string [a-z0-9 _@-], required
what: The name of the group, all statistics will be grouped into
key: search
values: array, not required
what: the fields to replace
key: replace
values: array, not required
what: the values to replace with
The following items:
- user/login For the TOKEN.
- user/database For the DATABASE_ID
- subscriber/findByEmail For the SUBSCRIBER_ID