Jump to content

Change Attention to in Mails


Recommended Posts

Hi,

I know it ist usual to be informal in the english spoken countires, so you can use in the mails

hello John Doe,

we thank for your order...

But in not all countries this version shows your respect to the customer. In german spoken countries you should write:

Dear Mr. Doe/Dear Mrs. Doe.

My question is: is there any mapping of which variable I can use in the mails ? To change this I need the variable for gender (you must also choose by account opening, so it must be already on database).

Also I need the variable for the order weight to add in the order confirmation mail. Also this must already exist, because the basket calculates the shipping rates...

Best regards

Conny

Link to comment
Share on other sites

You can edit your mail template in each language and use phrases more appropriate for each language.

To make the gender available in your order_conf.html and order_conf.txt mail templates, you'll need to change lines 308-309 of classes/PaymentModule.php (in PrestaShop v1.3.1) from:

$data = array(                    
'{firstname}' => $customer->firstname,



to:

$data = array(                    
'{gender}' => ($customer->gender == 1 ? 'Mr.' : ($customer->gender == 2 ? 'Ms.' : '')),
'{firstname}' => $customer->firstname,



This will create a {gender} variable with 'Mr.' if the gender is Male or 'Ms.' if the gender is female. If no gender was specified, then it will be blank.

To make the weight variable available in your order_conf.html and order_conf.txt mail templates, you'll need to change line 344 of classes/PaymentModule.php (in PrestaShop v1.3.1) from:

'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false, false));



to:

'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false, false),
'{total_weight}' => $order->getTotalWeight() . ' ' . Configuration::get('PS_WEIGHT_UNIT'));



This will add a {total_weight} variable you can use in your mail template with the total weight followed by the weight unit you entered on the Preferences > Localization tab.

Link to comment
Share on other sites

Hi, I tried, but I cannot get any mail copy to check if it works. Is there any adjustment to get all mails in copy ? It tried also to open an new customer account (fronted), but also for the opening of my new customer account I'm getting no mails, nor a copy.

I have changed the code post in http://www.prestashop.com/forums/viewthread/13297/general_discussion/copy_all_outgoing_email_in_prestashop but also no copy is received. Is the code also valid for 1.3.1.1 ?

Mail seems to work, because I'm getting the testmail. Standard I use SMTP, but also when I try with php-mailer no mail for account opening is coming in.

Link to comment
Share on other sites

In that post, I tried to write code to copy emails to another address, but failed to get it to work. It turns out to be more difficult than I thought. Hopefully, someone else will have more success. In the mean time, you'll need to create a test account and test order to check that the email is correct.

Link to comment
Share on other sites

In that post, I tried to write code to copy emails to another address, but failed to get it to work.
Yes I tried also to get a copy, this why a referenced to that post. I will discuss this matter with my provider, because I think there is anything wrong with the account. The customer account I created fronted was to get the account creation mail for verification and this mailaccount was a gmx account, perhaps they don't pass the mails ???

The testmail from backend works, but this is still the only one. So I cannot understand why all other mails do not work.
Link to comment
Share on other sites

  • 8 months later...

In PrestaShop v1.4, go to Tools > Translations, select "E-mail templates" in the dropdown, then click the flag for the language you want to translate. You can then change the email subject and content for that language.

Link to comment
Share on other sites

Thank you Rocky,

but I was talking about this:

$data = array(
'{gender}' => ($customer->gender == 1 ? 'Mr.' : ($customer->gender == 2 ? 'Ms.' : '')),
'{firstname}' => $customer->firstname,


What do I do when I am in several languages.?
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...