Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Folgende Fehlermeldungen können bei fehlerhaften Requests auftreten:

  • Invalid domain of sender address ("example.com"). If you want to send email for this domain, please contact your admin.
  • Validation error
  • No templateId AND no newsletterContent given!
  • SOAP-ERROR: Encoding: object has no 'subject' property
  • No subject given.
  • Invalid templateId!
  • Autoimport is running. Please try again later.
  • Filter with ID #id  is non existent.

Beispiel

Code Block
themeEclipse
languagephp
titleErstellen und Versenden eines Newsletters
firstline2
linenumberstrue
$client = new SoapClient($wsdlUrl);
$createMailingRequest = new StdClass();
$createMailingRequest->mandatorId = 0;
$createMailingRequest->newsletterContent = utf8_encode("<html><body>HTML-Inhalt des Newsletters</body></html>");
$createMailingRequest->alternativeContent = utf8_encode("Text-Inhalt des Newsletters");
$createMailingRequest->subject = utf8_encode("Betreff des Newsletters");
$createMailingRequest->senderName = "Absendername";
$createMailingRequest->senderEmail = "user@example.com";
$createMailingRequest->recipients = new StdClass();
$createMailingRequest->recipients->newsletterListId = 1;
date_default_timezone_set('Europe/Berlin');
$createMailingRequest->sendTime = time();
try {
  $result = $client->createMailing($createMailingRequest);
  var_dump($result);
} catch (Exception $e) {
  echo "\n" . $e->getMessage() . "\n";
  if (is_array($e->detail->ValidationError)) {
    foreach ($e->detail->ValidationError as $ve) {
      echo $ve . "\n"; 
    } 
  } else {
    echo $e->detail->ValidationError . "\n";
  }
}

...