no

Magento Email to a friend not working, even after updating product_share.html

After we have successfuly setup our magento store, we've been testing its functionality and found out that email to a friend is not work...

After we have successfuly setup our magento store, we've been testing its functionality and found out that email to a friend is not working properly. The product link and image are missing.

What we did:

1.) After checking the controller for sendfriend, I've found out that the variables used in the email template are initialize here:
app/code/core/Mage/Sendfriend/Model/Sendfriend.php (about line: 85), check if it's like this:

array(
'name' => $this->_names[$key],
'email' => $email,
'product_name' => $this->_product->getName(),
'product_url' => $this->_product->getProductUrl(),
'message' => $message,
'sender_name' => strip_tags($this->_sender['name']),
'sender_email' => strip_tags($this->_sender['email']),
//resize
'product_image' => Mage::helper('catalog/image')->init($this->_product, 'small_image')->resize(250),
)


Then check the email to a friend template and compare to this:

Welcome, {{htmlescape var=$name}}<br /><br />Please look at <a href="{{var product_url()}}">{{var product_name}}</a><br /><br />Message: <br />{{var message}}<br /><br /> <img src="{{var product_image}}" />


Take note of the variables used: like product_name, product_url and product_image. Each must be initialized properly.

Now, in our case even after making sure that the two files are updated, still email doesn't show the product link and image. Looking at the model I found out that the magento system queries the template from the database. So you need to update the template from there:
Table: core_email_template; template_code: Send product to a friend, with template_text:

Welcome, {{var name}}<br /><br />Please look at <a href="{{var product.getProductUrl()}}">{{var product.name}}</a><br /><br />Here is message: <br />{{var message}}<br /><br />


Now update the variables, product.getProductUrl(), etc. Refer to the variable we have defined above.

Related

server management 805907272289944011

Post a Comment

3 comments

Anonymous said...

This is a very fine piece of work it will save many of magento users from waste of time.
Web Design Templates

•▬●๋•ηáv€€ń●๋•▬• •▬●๋•کнαяmá●๋•▬• said...
This comment has been removed by the author.
terrylittrell said...

That's very simple and short good message about magento eCommerce. I think mostly shopping enterprise are using this magento eCommerce site. It's have fully futures.magento development

item