The file that you will need to modify in eStore is called "eStore_auto_responder_handler.php". This file has two functions that you will be interested in. These two functions are:
1. eStore_item_specific_autoresponder_signup
2. eStore_global_autoresponder_signup
These functions will automatically get called when eStore does the post payment processing and eStore will provide the following details of the customer to these functions:
- first name
- last name
- email address
You need to place your Interspire email marketing signup code inside these functions. To be more specific you will need to place something like the following (I got this sample code from the integration document you provided). You will need to place your username and usertoken in the code.. just read the code and you will understand as it's a fairly simple piece of code:
$xml = '<xmlrequest>
<username>admin</username>
<usertoken>d467e49b221137215ebdab1ea4e046746de7d0ea</usertoken>
<requesttype>subscribers</requesttype>
<requestmethod>AddSubscriberToList</requestmethod>
<details>
<emailaddress>'.$emailaddress.'</emailaddress>
<mailinglist>1</mailinglist>
<format>html</format>
<confirmed>yes</confirmed>
<customfields>
<item>
<fieldid>1</fieldid>
<value>'.$firstname.' '.$lastname.'</value>
</item>
</customfields>
</details>
</xmlrequest>
';
$ch = curl_init('http://www.yourdomain.com/IEM/xml.php');
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) {
echo "Error performing request";
}
else {
$xml_doc = simplexml_load_string($result);
echo 'Status is ', $xml_doc->status, '<br/>';
if ($xml_doc->status == 'SUCCESS') {
echo 'Data is ', $xml_doc->data, '<br/>';
} else {
echo 'Error is ', $xml_doc->errormessage, '<br/>';
}
}