l'image ne montre pas dans le courrier
-
16-10-2019 - |
Question
J'ai créé le module personnalisé, dans ce que j'ai envoyer un e-mail avec des informations produit avec l'image du produit. beau travail, mais l'image ne montre pas, seule URL affiche dans le courrier.
mon code est:
observer.php
public function customerRegisterSuccess(Varien_Event_Observer $observer)
{
if (Mage::registry('my_observer_has_run')) {
return $this;
}
Mage::register('my_observer_has_run', true);
....
$emailTemplateVariables['Product_Name'] = $information['name'];
$emailTemplateVariables['Product_Price'] = $information['price'];
$emailTemplateVariables['Product_SKU'] = $information['sku'];
$emailTemplateVariables['Product_Description'] = $information['description'];
if (count($product->getMediaGalleryImages()) > 0){
foreach ($product->getMediaGalleryImages() as $_image){
$thumbnail12 = Mage::helper('catalog/image')->init($product->getProduct(), 'image', $_image->getFile())->resize(2000);
$thumbnail13 = str_replace('/webApps/migration/productapi/new/','/',$thumbnail12);
$emailTemplateVariables['Product_Image']=$thumbnail13;
}
}
.....
}
dans locale\en_US\template\email\custom_mail.html
Thank You.<br /><br/><br/><br/>
<b>Product Details</b><br/><br/>
<a href="{{store url=""}}"><img src="{{var Product_Image}}" alt="{{var Product_Image}}" style="margin-bottom:10px;" border="0"/></a>
Product Name : {{var Product_Name}}.<br/>
Product Price : {{var Product_Price}}.<br/>
Product SKU : {{var Product_SKU}}.<br/>
Product Description : {{var Product_Description}}.<br/></br><br/><br/>
mon courrier de réception ci-dessous le texte.
Thank you,
Product Details
http://localhost/magento/media/catalog/product/cache/1/image/2000x/9df78eab33525d08d6e5fb8d27136e95/c/o/computer.jpg.
Product Name : Monitor.
Product Price : 1000.0000.
Product SKU : Dell001.
Product Description : Monitor.
mail reçoit, mais l'image ne montre pas dans le courrier.
Pouvez-vous me dire comment puis-je résoudre ce problème?
merci.
La solution
Je pense que parce que vous travaillez sur le courrier local et g ne sait pas chemin de l'image-hôte local essayer avec une URL de l'image en direct statique et vérifier son fonctionnement ou non
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange