Jump to content

Send to friend doesn't work


Didik

Recommended Posts

I having an issue on any browser. Error appears Your e-mail could not be sent. Please check the e-mail address and try again.

 

The email address is valid.  Using PHP email, default theme, PS 1.6.0.5.

 

There is another topic on this issue marked as solved but solutions doesn't seem right, to download this version again, more than a week after launch, and reinstall.

Edited by Dougadanny (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

HI

 

try this

 

 verify if file sendtoafriend-extra.tpl exist in theme/your theme/modules/sendtoafriend 

at the end of file you see

{addJsDef stf_secure_key=$stf_secure_key}
{addJsDefL name=stf_msg_success}{l s='Your e-mail has been sent successfully' mod='sendtoafriend' js=1}{/addJsDefL}
{addJsDefL name=stf_msg_error}{l s='Your e-mail could not be sent. Please check the e-mail address and try again.' mod='sendtoafriend' js=1}{/addJsDefL}
{addJsDefL name=stf_msg_title}{l s='Send to a friend' mod='sendtoafriend' js=1}{/addJsDefL}
{addJsDefL name=stf_msg_required}{l s='You did not fill required fields' mod='sendtoafriend' js=1}{/addJsDefL}

if the file not exist copy this and add into the sendtoafriend-extra.tpl of the module at the end of file after the last </div>

 

@++

 

Loulou66

Link to comment
Share on other sites

there are Two "sendtoafriend=extra.tpl" files one is in this diretory

/public_html/monsteryouthsports/themes/default-bootstrap/modules/

This one has the correct verbage you requested.

the other one is in 

/public_html/monsteryouthsports/modules/sendtoafriend/

Link to comment
Share on other sites

Hi,

 

My "sendtoafriend" module also doesn't work. It didnt work in 1.5 and also not in 1.6.

All other email functions do work as well the 'add to wishlist' button.

 

I have tried all sorts of solutions (like the ones mentioned above) but non of them worked.

 

Could someone please have a look at my site: Helanproducts.com ?

 

PrestaShop version: 1.6.0.6

Server information: Linux #1 SMP Tue Jan 7 11:37:54 MST 2014 x86_64

Server software version: Apache
PHP version: 5.4.19
Mail method: You are using the PHP mail function.

 

error_sendtoafriend.PNG?psid=1

 

 

Thank you in advance for your effort.

 

Richard

Link to comment
Share on other sites

Hi

 

i see your site the form data has been send on sendtofriend_ajax.php all adata are good

 

  1. action:
    sendToMyFriend
  2. secure_key:
    a7781bbe4e10e8afc960befb5892bb98
  3. name:
    test
  4. email:
  5. id_product:
    604
 
but the email is not send and retrun code 0
 
can you verify in module/sendtofriend/mails you have a folder EN and one or more other for all langues of your PS and in these folders you have file named send_to_a_friend.html and send_to_a_friend.txt
 
@++
 
Loulou66
Link to comment
Share on other sites

 

Hi

 

i see your site the form data has been send on sendtofriend_ajax.php all adata are good

 

  1. action:
    sendToMyFriend
  2. secure_key:
    a7781bbe4e10e8afc960befb5892bb98
  3. name:
    test
  4. email:
  5. id_product:
    604
 
but the email is not send and retrun code 0
 
can you verify in module/sendtofriend/mails you have a folder EN and one or more other for all langues of your PS and in these folders you have file named send_to_a_friend.html and send_to_a_friend.txt
 
@++
 
Loulou66

 

 

 

Hi Loulou66,

 

I can confirm the files are present in their resp. language folders (/modules/sendtoafriend/mails/..) and that they have "777" permissions.

Do you have more possibilities to what the problem could be?

 

Thanks for your effort so far.

 

Richard

Link to comment
Share on other sites

Hi

 

when i comprare the extra.tpl of theme and extra.tpl of module missing instruction for id_product then try

in theme/default_bootstrap/modules/sendtoafriend/sendtoafriend-extra.tpl

after
<p class="submit">
add
<input id="id_product_comment_send" name="id_product" type="hidden" value="{$stf_product->id}" />

empty all cache (smarty en browser) and test ^^

 

@++

 

Loulou66

  • Thanks 1
Link to comment
Share on other sites

HI

 

@Roz

 

you have 1 error  on your site when the sentofriend-ajax.php send email

Strict Standards: Declaration of Mail::Send() should be compatible with that of MailCore::Send() in /var/www/prestaPOL/override/classes/Mail.php on line 421

i see you have an ovverride of mail php  verify it

 

@++

 

Loulou66

Link to comment
Share on other sites

HI

 

@Roz

 

you have 1 error  on your site when the sentofriend-ajax.php send email

Strict Standards: Declaration of Mail::Send() should be compatible with that of MailCore::Send() in /var/www/prestaPOL/override/classes/Mail.php on line 421

i see you have an ovverride of mail php  verify it

 

@++

 

Loulou66

 

oh i just found the mail in the junk mail!

but is it really like that? no confirmation message that it was sent or something? 

Link to comment
Share on other sites

Hi

 

peharps that send the email but you  have an error with the override mail.php and that return die the function then no message

and you email go in junk mail its not good

 

@++

 

loulou66

 

hi loulou! can you help me how to fix it? :)

i haven't done any override on this or anything :)

Link to comment
Share on other sites

Hi

 

when i comprare the extra.tpl of theme and extra.tpl of module missing instruction for id_product then try

in theme/default_bootstrap/modules/sendtoafriend/sendtoafriend-extra.tpl

after
<p class="submit">
add
<input id="id_product_comment_send" name="id_product" type="hidden" value="{$stf_product->id}" />

empty all cache (smarty en browser) and test ^^

 

@++

 

Loulou66

 

Hi Loulou,

 

Now in both "..extra.tpl"  files the above code is displayed, but without any result.

I have unistalled/deleted the module and reinstalled, finding that the "theme" folder isnt automatically created.

 

Can you confirm there should be only 'one' file in the theme folder of this module?

 

Regards,

R.

Link to comment
Share on other sites

Hi 

 

yes in the folder theme/your_theme/module  its for the override tpl of modules for this theme then Ps use this tpl if exist else ps use tpl of the module

 

i tested on local server and internet with module and tpl theme default and that work fine

 

i think I think we need to  search other hand 

 

@++

 

Loulou66

Link to comment
Share on other sites

  • 5 months later...

Hi Janekx

 

i see your site you have an error that block the javascript  desactivate the minify for JS in Back office

 

Uncaught ReferenceError: blocksearch_type is not defined

 

fix this error ans test again module send to a friend 

 

@++

Loulou66

Link to comment
Share on other sites

HI

 

yes uncompress javascript and the module with error is  blocksearch

when i see in my local 1.0.6.9 on  blocksearch module i see in blocksearch-instantsearch.tpl :

$("#search_query_{$blocksearch_type}"
but in you site you have
$("#search_query_" + blocksearch_type)


then i think you must update your module blocksearch

 

@++

Loulou66

  • Like 1
Link to comment
Share on other sites

Thanks much, the reason is bloscksearch module, even with compresion js is on it works.

But in case of blocksearch I use version 1.5.2 and PS not offer me the update. What wersion you have and where to get newer?

 

Thanks

Jan 

Link to comment
Share on other sites

Hi 

 

ha ok i see  but on 1.5.6.2 but its same then for update this module on versio 1.3

 

1°) uninstall the module blocksearch and delete it

2°) donwload ps 1.5.6.2 

http://www.prestashop.com/download/old/prestashop_1.5.6.2.zip

3°) dezip it and transfert via filezilla de folder modules/blocksearch  in your site

4°) go in your BO and install this new version

5°) go in position for change position if the module isn't at his place

 

@++

Loulou66

Link to comment
Share on other sites

  • 3 weeks later...

I think I found the solution for issue with sending e-mails when logged in. Here is the code. I've put comment what need to be changed.

//get shop e-mail address and then replace the following line: ($module->context->cookie->// email ? $module->context->cookie->email : null) with $email
$email = Configuration::get('PS_SHOP_EMAIL',null,null,null);

		/* Email sending */
		if (!Mail::Send((int)$module->context->cookie->id_lang,
				'send_to_a_friend',
				sprintf(Mail::l('%1$s sent you a link to %2$s', (int)$module->context->cookie->id_lang), $customer, $product->name),
				$templateVars, $friendMail,
				null,
				$email,
				($module->context->cookie->customer_firstname ? $module->context->cookie->customer_firstname.' '.$module->context->cookie->customer_lastname : null),
				null,
				null,
				dirname(__FILE__).'/mails/'))
			die('0');
		die('1');
Edited by Duku (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Guys I had the same problem and none of the above worked for me, and I tried the following and it worked:

In /tools/swift/Swift/Message.php line #79
Change

$this->setFrom("");

To

$this->setFrom("[email protected]");
 
In /tools/swift/Swift.php after line 370
if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from);

Add the following code:

if (!$has_reply_to[0])
$message->setReplyTo($from->getAddress());
  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...