Contents |
Returns a single pixel img tag that sends data to Trigger Email Marketing via their API specification. The tag will automatically pull and use the clientid and client key as specified in Settings under the eCommerce tab. The tag will also automatically pull the email address using the orderGetEmail function for the passed order data array.
$tag = eV::TEMChannelTag($channel_id,$email,[,$dataArr][,$environment=test])
Returns a string containing the complete image tag - ready to be echo'd to the screen. Example value:
<img src=”https://secure.triggeremails.com/public/api/test/tem_eboapi.php?c=123456&ck=567890&e=test@test.com&ch=1234” height=”0” width=”0” border=”0”>
// set the channel id // this is provided by TEM $channel_id = "12345"; // get order data which will be used to extract email, first name $orderArr = eV::orderGetCompleteArray(); // get email which is required $email = eV::orderGetEmail($orderArr); // we also want to pass the first name // this is an optional customer fact $firstName = eV::orderGetFirstName($orderArr); $dataArr = array('f_first_name' => $firstName); // place this within the body tag of the 'thank you' page following email registration. echo eV::TEMChannelTag($channel_id,$email,$dataArr);
// set the channel id // this is provided by TEM $channel_id = "23456"; // we will need the order array to get necessary data to generate tag $orderArr = eV::orderGetCompleteArray(); // get email which is required $email = eV::orderGetEmail($orderArr); // convert order data into data array that function is expecting $dataArr = eV::TEMDataArr_conversion($orderArr); // get tag $tag = eV::TEMChannelTag($channel_id,$email,$dataArr); // output tag echo $tag;