Description
Use this feature to send the last newsletter of a mailing list to an arbitrary recipient that does not have to be present in the system. The newsletter will be personalized entirely and sent to the provided recipients. The amount of recipients is not limited, avoid providing too many recipients though, since a timeout of the HTML-protocol might occur.
Available starting from Backclick-Version: 5.8.1
In order to use this feature you have to provide the following information:
- Mandator ID
- API-Key (optional authentication, if not provided the IP address will be used for authentication)
- Recipient(s) of the last newsletter as an array with additional information that can or have to be made
- E-Mail address
- Mailing lists, IDs of lists you want the last newsletter to be sent to
- Recipients personal data necessary for personalization of the newsletter, provided as an array, optional
- Name of the field
- Value of the field
An object containing information whether the E-Mails were generated successfully will be the result. A faulty indication of a mailing list will not result in an error. If this feature returns FALSE, an error occurred while generating the E-Mail.
The following error messages can occur in a faulty request:
Example
$client = new SoapClient($wsdlUrl);
$sendLastNewsletterRequest = new StdClass();
$sendLastNewsletterRequest->mandatorId = 0;
$sendLastNewsletterRequest->recipients = array();
$recipient = new StdClass();
$recipient->emailAddress = "[email protected]";
$recipient->newsletterListIds = array(1);
$recipient->subscriberFields = array();
$subscriberField = new StdClass();
$subscriberField->fieldName = utf8_encode ("VORNAME");
$subscriberField->fieldValue = utf8_encode ("Marcel");
array_push($recipient->subscriberFields, $subscriberField);
$subscriberField = new StdClass();
$subscriberField->fieldName = utf8_encode ("NACHNAME");
$subscriberField->fieldValue = utf8_encode ("Hartwig");
array_push($recipient->subscriberFields, $subscriberField);
array_push($sendLastNewsletterRequest->recipients, $recipient);
try {
$result = $client->sendLastNewsletter($sendLastNewsletterRequest);
var_dump($result);
} catch (Exception $e) {
echo "Fehler aufgetreten: " . $e->getMessage() . "\r\n";
}
 object(stdClass)#6 (1) {
["success"]=>
bool(true)
}
Source code
Â
In order to test a working example you can download the source code.
Example for sending the last newsletter
Â