Zen Cart Logo
Forums / General Questions / how to send email in multiple languages?

how to send email in multiple languages?

Locked

Views: 6,331

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
29 Nov 2008, 11:26 PM
#1
asappia avatar

asappia

New Zenner

Join Date:
May 2008
Posts:
30
Plugin Contributions:
0

how to send email in multiple languages?

HI
my shop has many french customer, many italian and some english.

how to send an email whre the text is defined by the language of the customer ?

29 Nov 2008, 11:43 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: how to send email in multiple languages?

Unfortunately the current email system is one language and the default files are in english. Any other language and especially multi languages will require that you create some other system for these.

30 Nov 2008, 12:04 AM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: how to send email in multiple languages?

Language work for emails in a similar way the rest of Zen Cart, so the text for the Zen Cart standard emails is spread around the language files, though it's sometimes a challenge finding it. But if you have good language packs that should already be done for you.

The bigger challenge is that Zen Cart doesn't currently store a preferred language for customers, so emails generally go out in the site's default language, though I suspect that some of the Admin-generated emails may go out in the language being used at the time in the Admin.

30 Nov 2008, 12:09 AM
#4
asappia avatar

asappia

New Zenner

Join Date:
May 2008
Posts:
30
Plugin Contributions:
0

Re: how to send email in multiple languages?

kuroi:

Language work for emails in a similar way the rest of Zen Cart, so the text for the Zen Cart standard emails is spread around the language files, though it's sometimes a challenge finding it. But if you have good language packs that should already be done for you.

The bigger challenge is that Zen Cart doesn't currently store a preferred language for customers, so emails generally go out in the site's default language, though I suspect that some of the Admin-generated emails may go out in the language being used at the time in the Admin.

you got the point.
Testing show that the email using the template system go out with the language selected for the admin area during sending time.

mmm This seema big issue.
I've to send a coupon to customer and cannot find a way to send the in the right language.

But on my website I've customer with the language set by the GET...
what if I write an <img> linking to an image in my webserver in the email ?
would it be shown ?

30 Nov 2008, 12:21 AM
#5
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: how to send email in multiple languages?

You will have to store the customer preferred language somehow.

You can do something like this:
Create a language field in customer table, you can associate the default language there.

If the customer logged in, and choose a language (using the language sidebox etc) which is different from the language set in his/her setting, then you you make change in his/her setting.

The next time he/she visit and logged in, you can switch to his/her language automatically. You can also use this in the email sent out.

This is not easy job, but not very complicated.

30 Nov 2008, 12:25 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: how to send email in multiple languages?

Emails sent from the storefront use the language text defined in the language pack for the language selected by the customer during that visit to your site.

Emails sent from the admin will use the language text based on the language selected by the administrator at the time of sending the email.

But, your posts don't clearly explain what "problem" you have. What exactly is it you're trying to do?

30 Nov 2008, 12:36 AM
#7
asappia avatar

asappia

New Zenner

Join Date:
May 2008
Posts:
30
Plugin Contributions:
0

Re: how to send email in multiple languages?

DrByte:

Emails sent from the storefront use the language text defined in the language pack for the language selected by the customer during that visit to your site.

Emails sent from the admin will use the language text based on the language selected by the administrator at the time of sending the email.

But, your posts don't clearly explain what "problem" you have. What exactly is it you're trying to do?

I wish to send a mail in the customer language thru the admin interface (New discount coupon)

30 Nov 2008, 12:39 AM
#8
asappia avatar

asappia

New Zenner

Join Date:
May 2008
Posts:
30
Plugin Contributions:
0

Re: how to send email in multiple languages?

yellow1912:

You will have to store the customer preferred language somehow.

You can do something like this:
Create a language field in customer table, you can associate the default language there.

If the customer logged in, and choose a language (using the language sidebox etc) which is different from the language set in his/her setting, then you you make change in his/her setting.

The next time he/she visit and logged in, you can switch to his/her language automatically. You can also use this in the email sent out.

This is not easy job, but not very complicated.

I'd check if I can do this in the future, but now...
what if I send an html email to customer with a remote image (on my server)
on the GET I'll get the preferred language (but will it works ? will the webmail or the mail client let load a remote image ?)
(simplest for me)

Second I may select the default address country for people and send the email based on the country...

third I may use the IP address of the customer to geoip them, but... I don't know if I have an IP for every customer...

30 Nov 2008, 12:45 AM
#9
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: how to send email in multiple languages?

This is the easiest way to do it for now:

Create an ezpage(you will need the multi language plugin) or a define page. Then store the content of the newsletter on this page (with all language versions)

When you email your customer, you can just email them the link to this page, or you can email the content in default language along with the link to other languages.

30 Nov 2008, 12:59 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: how to send email in multiple languages?

asappia:

I wish to send a mail in the customer language thru the admin interface (New discount coupon)

Are you trying to send an email? or send a coupon?
Those are two different options.

30 Nov 2008, 10:20 PM
#11
asappia avatar

asappia

New Zenner

Join Date:
May 2008
Posts:
30
Plugin Contributions:
0

Re: how to send email in multiple languages?

DrByte:

Are you trying to send an email? or send a coupon?
Those are two different options.

I created a new discount coupon and in the coupon list I've the option to send customer that I've created a coupon.
it uses the "send email" api, with the email_template_coupon

1 Dec 2008, 7:32 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: how to send email in multiple languages?

You can specify coupon descriptions in multiple languages.
If you log into your Admin, and select a language, and go to the Coupon Administration menu, select a coupon (for which you've given descriptions in all available languages) and click "Email" to send that coupon to a particular customer, that email will be sent in the language selected in your admin menu.
It will use the admin language files for the selected language to build the TEXT email content, and will use the HTML template in the /email/XX/ folder to prepare the format of the HTML-portion of the emails.

FAQ reference: https://www.zen-cart.com/tutorials/index.php?article=113

HOW TO USE the HTML Mail Template System
The email template system operates through the email_*.htm files in your /email folder.

MULTIPLE LANGUAGES
You can duplicate the template files into language-specific folders using the language "short" code, using the following format:

/email/ = english/master
/emai//fr/ = french
/email/de/ = german
/email/es/ = spanish
...

If you don't copy a certain file into the language folder, the english master will be used.

1 Dec 2008, 8:38 AM
#13
asappia avatar

asappia

New Zenner

Join Date:
May 2008
Posts:
30
Plugin Contributions:
0

Re: how to send email in multiple languages?

DrByte:

You can specify coupon descriptions in multiple languages.
If you log into your Admin, and select a language, and go to the Coupon Administration menu, select a coupon (for which you've given descriptions in all available languages) and click "Email" to send that coupon to a particular customer, that email will be sent in the language selected in your admin menu.
It will use the admin language files for the selected language to build the TEXT email content, and will use the HTML template in the /email/XX/ folder to prepare the format of the HTML-portion of the emails.

FAQ reference: https://www.zen-cart.com/tutorials/index.php?article=113

I've read it. the problem is how to send a french mail (stated I know how to write in french) to a french customer, an italian mail to an italian one, and so on...

For now (because I had to send the email for the coupon) I created three new query in query_builder selecting the country of the customer (customers_default_address_id -> address_book), but this doesn't solve the case where a person lives in a country where there are more than one language (Canada for example).

The best should be save the language of the customer indeed. May this be a "Wishlist" ?

1 Dec 2008, 8:54 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: how to send email in multiple languages?

Sorry, I've misunderstood your messages. You used the word "customer" consistently, rather than the plural "customers", so I was of the impression you were trying to send a SINGLE email.

Your query_builder approach is probably most suitable for the bulk emailing that you are trying to accomplish.

The ability to let the customer select their own language preference will be included in v1.4.0 when it is released.

1 Dec 2008, 8:59 AM
#15
asappia avatar

asappia

New Zenner

Join Date:
May 2008
Posts:
30
Plugin Contributions:
0

Re: how to send email in multiple languages?

DrByte:

Sorry, I've misunderstood your messages. You used the word "customer" consistently, rather than the plural "customers", so I was of the impression you were trying to send a SINGLE email.

Your query_builder approach is probably most suitable for the bulk emailing that you are trying to accomplish.

The ability to let the customer select their own language preference will be included in v1.4.0 when it is released.

Wondeful :)

28 Apr 2009, 7:07 AM
#16
sachin1234 avatar

sachin1234

New Zenner

Join Date:
Nov 2008
Posts:
15
Plugin Contributions:
0

Re: how to send email in multiple languages?

Hello,
I want to run a cron job which automatically sends an email to my customers.
But the problem is I want to send the email in two different language
according to the customer set language preference.

For it I can use languages_id field from customers table and depending upon the language_id email is send to the each customer.