在最新的idevaffiliate中,不再有一個通用的郵件列表集成。以前的版本向我的郵件列表管理員(Interspire Email Marketer - IEM)發出了一個API調用(不是開發人員),當有人在idev註冊時,他們被添加到IEM的郵件列表中。idevAffiliate註冊後的意外輸出
然而,新帳戶有一個API觸發器。就我所能看到的差異而言,主IF在觸發器和通用郵件列表文件方面有所不同。
它用來啓動:
if ($MailingListAuth == true) {
但現在開始:
if ($NewAccountAPITrigger == true) {
然後調用。
問題是,現在我在創建新帳戶後在頁面上獲得了一些輸出。輸出是:
Response:
object(SimpleXMLElement)#20 (1) { [0]=> string(4) "2936" }
而頁面正常(它出現在頁面的左上角)。
但是新帳戶用戶被添加到郵件列表中,以便調用能夠正常工作,但不知道爲什麼或者如何消除頁面左上角的輸出。
下面是帳戶觸發器文件的精簡版本,主要部分完好無損,除了屏幕左上方的輸出外,正如前面提到的那樣工作?
<?PHP
if ($NewAccountAPITrigger == true) {
$username = check_type('username');
$email = check_type('email');
$xml = '<xmlrequest>
<username>MyAdminLoginNameGoesHere</username>
<usertoken>MyTokenGoesHere</usertoken>
<requesttype>subscribers</requesttype>
<requestmethod>AddSubscriberToList</requestmethod>
<details>
<emailaddress>'.$email.'</emailaddress>
<mailinglist>1</mailinglist>
<format>html</format>
<confirmed>yes</confirmed>
<customfields>
<item>
<fieldid>2</fieldid>
<value>'.$username.'</value>
</item>
</customfields>
</details>
</xmlrequest>';
$ch = curl_init('https://maydomainname.com/xml.php'); //CHANGE TO THE PATH OF YOUR IEM INSTALLATION
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$result = @curl_exec($ch);
if($result === false) {die("Error performing request");}
//var_dump($result); //for debugging purposes
//Example of how to display returned data
$xml_doc = simplexml_load_string($result);
if ($xml_doc->status == 'SUCCESS' && empty($xml_doc->data)) {die('Status is
success. Empty response.');}
if ($xml_doc->status == 'SUCCESS') {
echo 'Response: <br />';
var_dump($xml_doc->data);
} else {
echo 'Error is '. $xml_doc->errormessage;
}
}
?>
至於提到的用戶添加到郵件列表,所以這基本上是工作,但希望得到任何幫助我能解決這個問題。非常感謝任何指導。
非常感謝@IMSoP。奇怪的是,它從來沒有出現與以前的版本使用MailingListAuth == true變量。如果我得到進一步的問題,我在這裏的問題在stackoverflow,所以可以讓你那個熊。大聲笑再次感謝。 – Hawk007