Jump to content

FIX for Tell A friend CCv4.0.01


kinetic

Recommended Posts

I was writing a contact us form based off the tell a friend forms in CCv4.0.01 and noticed that although it does submit it does not pass the senders IP and does not pass the senders name in the subject line or body

you end up with a subject line like this

Product Recommended by {SENDER_NAME}

ok first things first lets fix the Senders IP

Open language/en/email.inc.php

FIND:

Sender's IP Address: {SERDER_IP}",




REPLACE with:


Sender's IP Address: {SENDER_IP}",




Save and Close: language/en/email.inc.php



next OPEN: includes/content/tellafriend.inc.php

FIND: 


	if ($floodControlPass) {

		## make email

		require("classes".CC_DS."htmlMimeMail".CC_DS."htmlMimeMail.php");

		$lang = getLang("email.inc.php");

		$mail = new htmlMimeMail();

		$macroArray = array(

			'RECIP_NAME'	=> sanitizeVar($_POST['recipName']),

			'MESSAGE'		=> stripslashes(sanitizeVar(strip_tags($_POST['message']))),

			'PRODUCT_URL'	=> $GLOBALS['storeURL'].'/index.php?_a=viewProd&productId='.sanitizeVar($_GET['productId']),

			'STORE_URL'		=> $GLOBALS['storeURL'],

			'SENDER_IP'		=> $_SERVER['REMOTE_ADDR'],

		);

		

		$text = macroSub($lang['email']['tellafriend_body'], $macroArray);

		unset($macroArray);

		

		$macroArray = array(

			"{SENDER_NAME}" => sanitizeVar($_POST['senderName'])

		);

		

		$mail->setText($text);

		$mail->setReturnPath($_POST['senderEmail']);

		$mail->setFrom($_POST['senderName'].' <'.$_POST['senderEmail'].'>');

		$mail->setSubject(macroSub($lang['email']['tellafriend_subject'], $macroArray));

		$mail->setHeader('X-Mailer', 'CubeCart Mailer');

		$send = $mail->send(array($_POST['recipEmail']), $config['mailMethod']);

	

	}




REPLACE WITH: 
	if ($floodControlPass) {

		## make email

		require("classes".CC_DS."htmlMimeMail".CC_DS."htmlMimeMail.php");

		$lang = getLang("email.inc.php");

		$mail = new htmlMimeMail();

		$macroArray = array(

			'RECIP_NAME'	=> sanitizeVar($_POST['recipName']),

			'MESSAGE'		=> stripslashes(sanitizeVar(strip_tags($_POST['message']))),

			'PRODUCT_URL'	=> $GLOBALS['storeURL'].'/index.php?_a=viewProd&productId='.sanitizeVar($_GET['productId']),

			'STORE_URL'		=> $GLOBALS['storeURL'],

			'SENDER_IP'		=> $_SERVER['REMOTE_ADDR'],

			'SENDER_NAME'	=> sanitizeVar($_POST['senderName'])

		);

		

		$text = macroSub($lang['email']['tellafriend_body'], $macroArray);

		

		$mail->setText($text);

		$mail->setReturnPath($_POST['senderEmail']);

		$mail->setFrom($_POST['senderName'].' <'.$_POST['senderEmail'].'>');

		$mail->setSubject(macroSub($lang['email']['tellafriend_subject'], $macroArray));

		$mail->setHeader('X-Mailer', 'CubeCart Mailer');

		$send = $mail->send(array($_POST['recipEmail']), $config['mailMethod']);

	

	}

Save and Close includes/content/tellafriend.inc.php

Upload both files back to your server and tell afriend will be working a real treat

hopefully this will make it into the next patch release.

Kinetic :)

Link to comment
Share on other sites

  • 3 months later...
Guest marline

I was writing a contact us form based off the tell a friend forms in CCv4.0.01 and noticed that although it does submit it does not pass the senders IP and does not pass the senders name in the subject line or body

you end up with a subject line like this

Product Recommended by {SENDER_NAME}

ok first things first lets fix the Senders IP

Open language/en/email.inc.php

FIND:

Sender's IP Address: {SERDER_IP}",




REPLACE with:


Sender's IP Address: {SENDER_IP}",




Save and Close: language/en/email.inc.php



next OPEN: includes/content/tellafriend.inc.php

FIND: 


	if ($floodControlPass) {

		## make email

		require("classes".CC_DS."htmlMimeMail".CC_DS."htmlMimeMail.php");

		$lang = getLang("email.inc.php");

		$mail = new htmlMimeMail();

		$macroArray = array(

			'RECIP_NAME'	=> sanitizeVar($_POST['recipName']),

			'MESSAGE'		=> stripslashes(sanitizeVar(strip_tags($_POST['message']))),

			'PRODUCT_URL'	=> $GLOBALS['storeURL'].'/index.php?_a=viewProd&productId='.sanitizeVar($_GET['productId']),

			'STORE_URL'		=> $GLOBALS['storeURL'],

			'SENDER_IP'		=> $_SERVER['REMOTE_ADDR'],

		);

		

		$text = macroSub($lang['email']['tellafriend_body'], $macroArray);

		unset($macroArray);

		

		$macroArray = array(

			"{SENDER_NAME}" => sanitizeVar($_POST['senderName'])

		);

		

		$mail->setText($text);

		$mail->setReturnPath($_POST['senderEmail']);

		$mail->setFrom($_POST['senderName'].' <'.$_POST['senderEmail'].'>');

		$mail->setSubject(macroSub($lang['email']['tellafriend_subject'], $macroArray));

		$mail->setHeader('X-Mailer', 'CubeCart Mailer');

		$send = $mail->send(array($_POST['recipEmail']), $config['mailMethod']);

	

	}




REPLACE WITH: 
	if ($floodControlPass) {

		## make email

		require("classes".CC_DS."htmlMimeMail".CC_DS."htmlMimeMail.php");

		$lang = getLang("email.inc.php");

		$mail = new htmlMimeMail();

		$macroArray = array(

			'RECIP_NAME'	=> sanitizeVar($_POST['recipName']),

			'MESSAGE'		=> stripslashes(sanitizeVar(strip_tags($_POST['message']))),

			'PRODUCT_URL'	=> $GLOBALS['storeURL'].'/index.php?_a=viewProd&productId='.sanitizeVar($_GET['productId']),

			'STORE_URL'		=> $GLOBALS['storeURL'],

			'SENDER_IP'		=> $_SERVER['REMOTE_ADDR'],

			'SENDER_NAME'	=> sanitizeVar($_POST['senderName'])

		);

		

		$text = macroSub($lang['email']['tellafriend_body'], $macroArray);

		

		$mail->setText($text);

		$mail->setReturnPath($_POST['senderEmail']);

		$mail->setFrom($_POST['senderName'].' <'.$_POST['senderEmail'].'>');

		$mail->setSubject(macroSub($lang['email']['tellafriend_subject'], $macroArray));

		$mail->setHeader('X-Mailer', 'CubeCart Mailer');

		$send = $mail->send(array($_POST['recipEmail']), $config['mailMethod']);

	

	}

Save and Close includes/content/tellafriend.inc.php

Upload both files back to your server and tell afriend will be working a real treat

hopefully this will make it into the next patch release.

Kinetic :mellow:

Do you know how to fix TAF in 3.0.15 or beyond?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...