Hermeswein Posted October 20, 2011 Share Posted October 20, 2011 Dear all, I have a specific question regarding the Prestashop eMail module. By default Prestashop includes the Shop Logo into the eMail via the variable {shop_logo}. This function is brilliant as it includes the shop logo into the eMail (rather than just linking to it), so that most eMail clients show the picture automatically when opening the eMail (as it is no security risk as nothing is loaded from the server). Now I want to include one additional picture into the eMail (In my case: The signature of the shop owner at the bottom of the eMail). From what I can see I can only include this second picture via the standard "Include-Picture" function of the WYSIWYG editor. Unfortunately this makes the eMail only linking to the picture on the server. This of course makes most eMail clients not show the additional picture (see screenshot due to the default security-setting of most eMail clients to not load content from an external server). Therefore my question is the following: 1) Is there a possibility to include another picture into the eMail? (--> the same way than the logo is integrated) 2) Or is there maybe another variable such as {shop_logo} which could be "misused" for doing so? 3) Is there maybe a possibility to create another picture-varialbe e.g. {shop_signature} which could be linked hardcoded to a specific picture on the server? Best regards and thanks a lot ina advance, SirDaedalus Link to comment Share on other sites More sharing options...
phrasespot Posted October 23, 2011 Share Posted October 23, 2011 On 10/20/2011 at 1:14 PM, Hermeswein said: 1) Is there a possibility to include another picture into the eMail? (--> the same way than the logo is integrated) Yes, requires changes/overrides to some files. Quote 2) Or is there maybe another variable such as {shop_logo} which could be "misused" for doing so? No Quote 3) Is there maybe a possibility to create another picture-varialbe e.g. {shop_signature} which could be linked hardcoded to a specific picture on the server? Yes, see reply to 1. Short of making the changes above, a data URI may be your answer which is basically a way to include data in-line in e.g. a HTML email. You just add a normal img element but instead of using a normal URL in the src attribute you provide a data URI. This is basically equal (and simpler) to the Swift's method of inlining an image in the HTML email using a cid URI. There are several web URLs that can covert an image input to data URI output; Google it. Let me know if you have difficulty finding one. Link to comment Share on other sites More sharing options...
Superbegood31 Posted March 4, 2013 Share Posted March 4, 2013 Hello, First, I apologize for my English, I'm French. I dig the post because I will wish to include images in my emails as cid: ... Thanks Link to comment Share on other sites More sharing options...
Carlsen Posted June 18, 2013 Share Posted June 18, 2013 (edited) This applies to Prestashop 1.4 and is a core modification Go to the img folder and upload the image you wish to include in your e-mail. Lets call this "logo_mail_second.jpg" Open Mail.php inside the classes directory Around line 180 you will find $templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.'logo_mail.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_mail.jpg'))) : ((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo.jpg'))) : ''); Below these three lines you can insert a copy and adapt it to your needs. If you insert this code below the original: $templateVars['{shop_logo_second}'] = (file_exists(_PS_IMG_DIR_.'logo_mail_second.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_mail_second.jpg'))) : ((file_exists(_PS_IMG_DIR_.'logo_mail_second.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_mail_second.jpg'))) : ''); - You can output the image (logo_mail_second.jpg) in your e-mails by writing <img src="{shop_logo_second}" /> Edited June 18, 2013 by Carlsen (see edit history) 1 Link to comment Share on other sites More sharing options...
sebastians Posted July 28, 2013 Share Posted July 28, 2013 It seems that mail.php has changed in 1.5.4 - how can I put a second image in the emails there? Thanks! 1 Link to comment Share on other sites More sharing options...
fransjaeger Posted August 5, 2015 Share Posted August 5, 2015 Hello I am running version 1.6.0.9 and looking for a way to attach the logo. I think its better than linking to image on server. Anybody did this? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now