Re: Eigenes Double Opt-In
Verfasst: 06.12.2018, 14:07
Vielen Dank, jetzt klappt alles!
Super Support hier!
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Super Support hier!
Code: Alles auswählen
if($_GET['nl']==="1"){
require_once($_SERVER['DOCUMENT_ROOT']."/swm/api/nusoap/lib/nusoap.php");
# url to api.php
$api = $_SERVER['DOCUMENT_ROOT'].'/swm/api/api.php';
$uri = $api.'?wsdl';
// set your api key here
$apikey = '<APIKEYMEINESBENUTZERS>';
$client = new nusoap_client($api);
$client->soap_defencoding = 'UTF-8';# use UTF-8!
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
# set APIToken
$client->setHeaders(array('APIToken' => $apikey));
# sample: api_Mailinglists.api_createMailingList
# $params = array("apiName" => "Test list", "apiDescription" => "", "apiSubscriptionType" => "SingleOptIn", "apiUnsubscriptionType" => "DoubleOptOut", "apiOptInConfirmationMailFormat" => "PlainText", "apiOptOutConfirmationMailFormat" => "PlainText");
# sample: api_Recipients.api_createRecipient
# $params = array("apiMailingListId" => 1, "apiData" => array( "u_EMail" => "webmaster@johndoe.com", "u_LastName" => "Doe", "u_FirstName" => "John" ), "apiarrayGroupsIds" => array(), "apiUseDoubleOptIn" => false);
$params = array("apiMailingListId" => 2, "apiData" => array( "u_EMail" => $validate_email ), "apiarrayGroupsIds" => array(55), "apiUseDoubleOptIn" => false, "apiFormId" => 2);
$result = $client->call('api_Recipients.api_createRecipient', $params, '', '', false, true);
?>
<!---
<?php
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
var_dump($result);
echo '</pre>';
}
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>
-->
<?php
}
Code: Alles auswählen
if($_GET['nl']==="1"){
$ch = curl_init('https://<PFADZUSUPERWEBMAILER>/nl.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'u_EMail='.$validate_email.'&MailingListId=2&FormId=2&FormEncoding=utf-8&Action=subscribe');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
}