immagine non viene visualizzato nella posta
-
16-10-2019 - |
Domanda
Ho creato il modulo personalizzato, in questo devo inviare un'email con informazioni di prodotto immagine prodotto. lavorando bene ma immagine non viene visualizzata, solo URL è la visualizzazione nella posta.
il mio codice è:
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;
}
}
.....
}
in 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/>
email Il mio ricevente sotto il testo.
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.
di posta riceve ma l'immagine non viene visualizzata nella posta.
potete dirmi come posso risolvere questo problema?
Grazie.
Soluzione
Credo perché si sta lavorando su posta locale e G non sapere locale-host percorso dell'immagine provare con un po 'statico URL dell'immagine dal vivo e controllarne il funzionamento o meno
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange