Jump to content

Questions about mail


Recommended Posts

Dear fellow prestashoppers,

 

I'm still quite new to the whole Prestashop thing, and I've been searching a bit for answers to these questions, but I can't find anything. It might be because I, being a newbie, don't really know what to search for yet. Anyway, here we go, and I apologize if this has already been answered somewhere that I couldn't find.

 

Changing the e-mail templates

I've created a theme by copying the default theme using the backend tool, and I've made changes to it for a few months and everything has gone well. Now I tried changing an e-mail template through the translations page and I chose e-mail templates > my theme (Prettypegs) > English. Upon pressing save I got this error message.

Cannot write language file for e-mail subjects, path is: /var/www/themes/prettypegs/mails/en/lang.php

I looked in the folder and found that there was no mail folder in the theme directory at all, so I went back and chose to edit the default e-mail template instead, which worked, and I could verify that the file on disk had changed too. Then I made a test purchase, and I got the old e-mail sent to me. I'm very confused - does my theme have its own e-mail templates, and if so, where are they stored?

 

Adding details to the e-mail templates

The second question, and it's related to the first one, is where and when the smarty variables for the templates are built. I want to add shipping information depending on the provider they chose. Will that need to be added to the database upon purchase somehow, or is it accessible when sending the e-mail later on?

 

Languages

We are not providing users with their own accounts, so everything is guest checkouts. What decides what language template is being used when sending e-mails then? I've noticed that PayPal for example becomes localized after I enter country in the registration process, or does it see what language I was viewing the page in when making the purchase, or does it just send in the default language when I'm not registered?

 

Thank you for taking your time to read this, and I hope my questions are clear.

 

Best regards,

Anton

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

Anton,

 

if you're Ok with editing the email tempalte in pure HTML, I would suggest you to go for it. I personally don't like the PS email editor as it happened to me many times that the theme itself (after being saved) didn't look like it was supposed to.

I don't think your theme has special email themes (at least I've not seen it before). I would say there was an error while trying to save the newly edited theme.

 

About the variables - if you want to add a new (I guess you're now talking about the Order Confirmation email that everyone recieves) go to /classes and open PaymentMOdule.php.

Here, look for array containg variables in this form

'{firstname}' => $customer->firstname,

You can simply copy the structure to obtain new varaible.

Lately for one of my clients I had to put Message in the first email I did so by putting this code into the array

'{message}' => $customer_message->message,

 

About the last question, I am not entirely sure as it's recommended for each language to have its own domain and installation (Mostly because of Database which gets filled up quite quickly and is therefore slower..)

 

I hope this answers at least the first two questions.

  • Like 1
Link to comment
Share on other sites

Thank you for your quick response!

 

That's good to know about the editor! I'm not sure I understand the next bit though, because I've changed the files /mails/en/order_conf.html and .txt on the server, but I'm still getting the old e-mail sent to me. Do you have any ideas why this might be?

 

For the second one: got it! Thanks!

 

If I put the different languages on different servers, can I still use features like advanced stock management globally, and keep the shopping cart when I change language? Because those are the main reasons why we didn't want to use multistore for some other issues that we've had to work around.

 

That reminds me of another unrelated question:

We sell legs for sofas and beds, and no matter which combinations of legs you choose (colour and size), you have to choose fittings to go along with it. We've added these fittings as attributes, as that's what made the most sense to us (although it does make it more time consuming to update prices, and also more difficult to make nice looking prices for multiple currencies). We have yet to start using the advanced stock management, but we want to start as soon as possible. However, since the legs (regardless of combination) and fittings are different items (and the number of fittings in stock is irrelevant for us), I've been thinking about how to best implement it. The only thing I can really think of that would work, although it's a pretty ugly hack, is to track all the changes made to the stock and change all orders to look as if they had the same fitting. Do you think this would be a bad idea, and do you have any ideas for a simpler or more elegant solution?

 

Thanks again for your great response!

 

Best regards,

Anton

Link to comment
Share on other sites

I will be on vacation for a couple of weeks as of tomorrow, so don't feel forced to respond quickly when I'm gone! Someone else might take my place when I'm gone, but I don't know about that yet. Have a great summer everyone!

 

Best regards,

Anton

Link to comment
Share on other sites

Hi Friend,

 

Can u tell me how to edit massage subject line?

 

Suppose if we register on shop. We get email as with below subject

 

<Shop Name> Welcome

 

So is there is anyway to remove this shop name field?

 

Thanks

 

Anton, if you're Ok with editing the email tempalte in pure HTML, I would suggest you to go for it. I personally don't like the PS email editor as it happened to me many times that the theme itself (after being saved) didn't look like it was supposed to. I don't think your theme has special email themes (at least I've not seen it before). I would say there was an error while trying to save the newly edited theme. About the variables - if you want to add a new (I guess you're now talking about the Order Confirmation email that everyone recieves) go to /classes and open PaymentMOdule.php. Here, look for array containg variables in this form
'{firstname}' => $customer->firstname,

You can simply copy the structure to obtain new varaible. Lately for one of my clients I had to put Message in the first email I did so by putting this code into the array

'{message}' => $customer_message->message,

About the last question, I am not entirely sure as it's recommended for each language to have its own domain and installation (Mostly because of Database which gets filled up quite quickly and is therefore slower..) I hope this answers at least the first two questions.

Link to comment
Share on other sites

  • 4 weeks later...

Changing the e-mail templates

I've created a theme by copying the default theme using the backend tool, and I've made changes to it for a few months and everything has gone well. Now I tried changing an e-mail template through the translations page and I chose e-mail templates > my theme (Prettypegs) > English. Upon pressing save I got this error message.

 

I looked in the folder and found that there was no mail folder in the theme directory at all, so I went back and chose to edit the default e-mail template instead, which worked, and I could verify that the file on disk had changed too. Then I made a test purchase, and I got the old e-mail sent to me. I'm very confused - does my theme have its own e-mail templates, and if so, where are they stored?

 

It's bug in the AdminCustomerThreadsController.php, where is by me line 415:

  sprintf(Mail::l('An answer to your message is available #ct%1$s #tc%2$s', $ct->id_lang), $ct->id, $ct->token),

 

You should update to:

 

  sprintf(Mail::l('An answer to your message is available', $ct->id_lang), $ct->id, $ct->token),

 

... and all works fine :)

  • Like 2
Link to comment
Share on other sites

It's bug in the AdminCustomerThreadsController.php, where is by me line 415:

  sprintf(Mail::l('An answer to your message is available #ct%1$s #tc%2$s', $ct->id_lang), $ct->id, $ct->token),

 

You should update to:

 

  sprintf(Mail::l('An answer to your message is available', $ct->id_lang), $ct->id, $ct->token),

 

... and all works fine :)

 

Have you submitted this to the forge as a bug? Or I think with your obvious expertise you could figure out github. Thanks for this fix that solved this here and on another thread. If you can update this thread with bug report number of github fix..that would be really great. Thanks for your help with this issue.

Link to comment
Share on other sites

  • 3 weeks later...
  • 5 weeks later...

It's bug in the AdminCustomerThreadsController.php, where is by me line 415:

	  sprintf(Mail::l('An answer to your message is available #ct%1$s #tc%2$s', $ct->id_lang), $ct->id, $ct->token),
You should update to:

 

	  sprintf(Mail::l('An answer to your message is available', $ct->id_lang), $ct->id, $ct->token),
... and all works fine :)

 

 

I'm having the same problem and that didn't fix it :(

 

any other suggestion?

Link to comment
Share on other sites

  • 2 years later...
  • 1 year later...
×
×
  • Create New...