Jump to content

[SOLVED] Help to remove email logo attach in ps 1.5.3.1


Recommended Posts

Hi!

Someone know what I have to do to remove email logo attach in Prestashop 1.5.3.1 when Prestashop send emails when an order state is changed? (the logo is html embebed, we don't like that it will be attached as file in the email).


Thanks!!!

Prestashop Version 1.5.3.1

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

If I comment this line:

/*

if (isset($logo))

$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));

*/

 

In version 1.5.3.1 doesn't works. It is sending the logo attach in email...

 

What's wrong?

 

Thx

Link to comment
Share on other sites

here is 'untested' code for 1.5.3.1

 

Note I added two lines of code surrounded by comment

 

  if (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL')))
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL');
  else
  {
if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO')))
 $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO');
else
 $template_vars['{shop_logo}'] = '';
  }
  //don't attach logo
  unset($logo);
  $template_vars['{shop_logo}'] = '';
  //end of dont' attach logo
  /* don't attach the logo as */
  if (isset($logo))
$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));

Edited by El Patron
modified $logo = null to an unset (see edit history)
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 5 weeks later...

not work for me. Presta 1.5.4.1. Have remove logo from email template and comment lines in classes/Mail.php:



/*
if (isset($logo))
$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));
*/

:(

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

  • 2 months later...

In my case I wanted to prevent PS from attaching the logo to emails and have {shop_logo} variable contain path to the logo image saved on the server in PS folder. In this case the logo would still appear in emails but would not be embedded in them. Here is what did:
 
In /classes/Mail.php I commented out the following two lines:
 

if (isset($logo))
   $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));

and added another line of code right below:

$template_vars['{shop_logo}'] = Tools::getHttpHost(true).__PS_BASE_URI__.'img/'.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop);

For this to work you need to have an email logo image uploaded in BO->Settings->Themes. My PS version is 1.5.6.1.

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

  • 1 year later...

HI would this (below) also work for Prestashop 1.6.9? Would the image path be the same also.

Many thanks

In my case I wanted to prevent PS from attaching the logo to emails and have {shop_logo} variable contain path to the logo image saved on the server in PS folder. In this case the logo would still appear in emails but would not be embedded in them. Here is what did:
 
In /classes/Mail.php I commented out the following two lines:
 

if (isset($logo))
   $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));

and added another line of code right below:

$template_vars['{shop_logo}'] = Tools::getHttpHost(true).__PS_BASE_URI__.'img/'.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop);

For this to work you need to have an email logo image uploaded in BO->Settings->Themes. My PS version is 1.5.6.1.

Link to comment
Share on other sites

  • 3 weeks later...

SImilar issue here. The header logo is sent in translated emails as an attachment. In English language this header works just perfect, but not in translated mails. I have not touched to header in the mail itself.

 

Also another issue: The generated link in translated emails do not work anymore.....

 

Any help?

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...
  • 3 months later...

here is 'untested' code for 1.5.3.1

 

Note I added two lines of code surrounded by comment

 

   if (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL')))
	$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL');
   else
   {
	if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO')))
	 $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO');
	else
	 $template_vars['{shop_logo}'] = '';
   }
   //don't attach logo
   unset($logo);
   $template_vars['{shop_logo}'] = '';
   //end of dont' attach logo
   /* don't attach the logo as */
   if (isset($logo))
	$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));

This worked for me in Prestashop 1.6.14

Do note that the logo will be deleted in all email messages!

Link to comment
Share on other sites

  • 1 year later...

using ftp, find classes/Mail.php

 

there you will find code that assigns the logo, note the following code is from 1.5.5.0.

 

You can basically comment out the code that assigns the logo.

 

NOTE I DID NOT TEST THIS...MAKE SURE TO FIRST MAKE A BACK UP OF THIS FILE

 

08.31.2013-11.50.png

http://screencast.com/t/HJZtbPi1wy

 

Thanks for solution. It works but I want to delete logo attachment only in mail alerts (confirmation email to admin). How to do this?

Link to comment
Share on other sites

×
×
  • Create New...