Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49221

How can I change the language and personalize the mail when sending mail to each user of a particular role?

$
0
0

The rule to send a mail to every user of a particular role is very cool.

However, I am on a multilingual site, and the language of the mail should change depending on the language preference of that user.

I thought of having one dedicated role per language and send a single language mail for each of these roles. I think that would work rather nicely, apart from the ballast of the need of multiple roles for this purpose. Each rule would simply have its own, single language, untranslated mail contents.

As a user has to check a checkbox in his profile to get such a mail, I just make a rule to grant the proper language dependent role instead of all the same role, this should be mostly transparent.

Except for a few small problems.

  1. If the user changes his preferred language after checking this checkbox he'll get mails in the wrong language. I don't think this is a real problem.
  2. [node:url] includes the language selector and that is likely not the preferred language of said user.
  3. Management wants to add a line to the mail to let the user unsubscribe. That would be a link to his own profile.. Yes, that implies a personalized mail.

There's a more fine way to select the users other than "everybody having a role", namely using "data selectors", but it's not clear to me how to use them, and I doubt if [site:current-user] is the recipient of the mail...

Questions:

  1. Is there a less ugly way to solve my problem, one that translates the mail depending on the current language of said user?
  2. Is there a solution for my minor problems?

Viewing all articles
Browse latest Browse all 49221

Trending Articles