Forum

Thread tagged as: Blog, Forms, Members

Language specific automated emails and system emails

Hi there,

I wonder If you could point me in a right direction. I have a multi language website and few automated emails coming from the form, blog and members app. How would you send out all the trigger mails and notifications depending on a language version that user have set? It would be great to either somehow appoint various email templates for each language variants or inject email content dynamically from Perch.

Thanks a lot, Damian

Damian Drozdowicz

Damian Drozdowicz 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't think of a way to do that right now.

Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

Is there no way new members registered via let's say German version could receive something like welcome_de.html email template? Perhaps a language variable could be stored somewhere within the members app or the CMS itself?

Drew McLellan

Drew McLellan 2638 points
Perch Support

There are lots of possible solutions for implementing that functionality, but none that exists in its current form.

Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

What would you do? What's the least invasive way ( = no fiddling with the Perch Core )?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Where is the language option held?

Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

It's called before Perch is initialised on the page:

include_once(dirname(__FILE__) . '/../cms/runtime.php');
PerchSystem::set_var('lang', LANG);
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so it's not part of the member profile?

Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

The language is set globally per user session on all the pages. Do you suggest binding a language variable's value to a member and then act upon it? I guess the main issue I struggle with is the welcome email that is sent via the admin panel where the session variable no longer lives.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure you can use conditionals in the template, so this probably still isn't possible with the app as it stands.

Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

Alright, thanks for your input anyway Drew. I wonder if improved multi-language handling is worth considering in future Perch releases?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, it's something we'll be considering.

Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

That would be great. Thanks a lot!