Jump to content

All emails have always empty body


Recommended Posts

Hello,

i use a Leo theme, and i am testing email sending and all emails i have sent have an empty content. I've tried to change MIME format (HTML or TEXT), but content still empty. I've tried too to change email template title by traduction tab in back office, with "no theme selected", default theme, and leo theme, but it sill doesn't work.

 

How can i edit correctly my emails templates ?

 

Thanks in advance.

Link to comment
Share on other sites

  • 2 weeks later...

I've finally found the solution :

My problem was in PaymentModule class, function getEmailTemplateContent at the first line. Prestashop, and I don't know why, can't retrieve the value PS_MAIL_TYPE in ps_configuration with Configuration::get('PS_MAIL_TYPE').

 

So I've replaced at line 989 the line :

$email_configuration = Configuration::get('PS_MAIL_TYPE');

by

$email_configuration = Db::getInstance()->getValue("SELECT value from ps_configuration WHERE name='PS_MAIL_TYPE'");

And for the account confirmation mail, go to the line 95 in class Mail.php, function Send, and add after :

$configuration = Configuration::getMultiple(array(
            'PS_SHOP_EMAIL',
            'PS_MAIL_METHOD',
            'PS_MAIL_SERVER',
            'PS_MAIL_USER',
            'PS_MAIL_PASSWD',
            'PS_SHOP_NAME',
            'PS_MAIL_SMTP_ENCRYPTION',
            'PS_MAIL_SMTP_PORT',
            'PS_MAIL_TYPE'
        ), null, null, $id_shop);

the following line :

$configuration['PS_MAIL_TYPE'] = Db::getInstance()->getValue("SELECT value from ps_configuration WHERE name='PS_MAIL_TYPE'");

If someone can explain why Configuration get method works for some value and not for few values, even if theses values exist in "ps_configuration" table ... !

 

My solution is a dirty solution, but it works fine ;)

 

I will marked this topic as "solved" :)

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...