Skip to Content Skip to Menu

Multilingual plan configuration - workflow email translations doesn't work

3 weeks 6 days ago #340142 by schrammelmann
Hi all,
I'm currently trying to make e-mail notifications from CB Subs multilingual.
(Joomla!3, CBSubs 4.8.0, System Default Language German)

CB Subs -> Plans -> Edit Subscription Plan x -> Tab 'Presentation':
All fields with a text editor seem to work as expected.
Example: 'Description of plan' - if I enter 'REG_CLUB_DESC' here, the translation with the key '<p>REG_CLUB_DESC</p>' takes effect.
This also works for all other workflow fields that use a text editor.

It doesn't seem to work for e-mail fields (without an editor).
I have tried all possible combinations. HTML mail/text mail with and without <p> tags.
The mails only ever contain the key, never the text.

The fields are specified as: 'language translations are supported'
Is there something special to bear in mind here, or is it a bug?

This applies to all workflow e-mail fields (subject and text):
Email on first activation, Email on pending first payment, Email at each manual renewal...
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48867
  • Thanks: 8349
  • Karma: 1449
3 weeks 5 days ago #340145 by krileon
Those emails are passed through language API so it should work perfectly fine. Ensure all your languages are translating it though including the Default English language plugin. It should send in the language of the recipient.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

3 weeks 5 days ago - 3 weeks 5 days ago #340148 by schrammelmann
My website has been multilingual for a long time without any issues. Only the mails from CB Subs are missing. I wanted to fix that now.

I did extensive tests again on a clone of my live site.

PROBLEM WORKFLOW MAILS

The following plan workflow emails work (subject and body):
  • Email on pending first payment
  • Email on pending payment of manual renewal
The following planned workflow emails do not work (neither subject nor body):
  • Email on first activation
  • Email at each manual renewal
  • Email on expiration
Not tested:
  • Email at each automatic renewal
  • Email on cancellation by user
 NEW PROBLEM WITH MAILER

During my tests, I also encountered an even stranger problem with the mailer. I have a single mail rule there. See screenshot for how this mailer behaves.

The column L I added stands for the user's language settings. A dash means default.
Reminder: my default language is German, not English! Please also note the different result languages under the same conditions!

Furthermore, it seems that only the subject is translated, never the mail body, which always only contains the language key!

In the MySQL database, I saw in the 'j30_cbsubs_mailer_sentmails' table that the body looks like this in the mailer:<p><p>LANGUAGE_KEY<\p><\p>

I therefore also tried it with the complete string as the key, but that didn't change anything. The text was not translated.
Attachments:
Last edit: 3 weeks 5 days ago by schrammelmann.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48867
  • Thanks: 8349
  • Karma: 1449
3 weeks 4 days ago #340151 by krileon

In the MySQL database, I saw in the 'j30_cbsubs_mailer_sentmails' table that the body looks like this in the mailer:<p><p>LANGUAGE_KEY<\p><\p>

That would be your issue. We don't support inline translations. TinyMCE has this annoying habit of wrapping everything in paragraph elements. You have to turn that off in your TinyMCE settings by adjusting new lines to use linebreaks. I don't know of any other way to fix that.

I've reviewed the mailer code and it's absolutely passed through translations. The only reason for it to not translate is the language key used wasn't found in the language strings loaded. Where are you putting these language overrides? I suggest putting them in your CB language plugins and not your CBSubs language plugins as the CB language plugins will be more reliable when language switching.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

3 weeks 4 days ago #340155 by schrammelmann
Did you just check the code or did you also test an e-mail?

I'm not a newbie, I only ask for help when I have absolutely no more ideas.
I tested all possible combinations and tried with both language files (subs + normal cb)

Why do two of the workflow e-mails work and the rest don't?
Where does the double p tag come from? TinyMCE only adds one. 

However, my users will continue to receive the emails in German for the time being. I don't have any more time to provide evidence. Maybe I'll find the problem later. Maybe both problems are related to Joomla! 3 and it will go away if I migrate to 5. We will see. Thx

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48867
  • Thanks: 8349
  • Karma: 1449
3 weeks 4 days ago #340157 by krileon

Where does the double p tag come from? TinyMCE only adds one.

I've no idea, we don't apply any formatting to emails. That's entirely on whatever WYSIWYG editor you're using. I've my TinyMCE set to use linebreaks for new lines instead of paragraphs to avoid it from doing this.

I tested all possible combinations and tried with both language files (subs + normal cb)

My recommendation is to always add new language strings to CBs language plugins. This is where I've put my test language keys.

Did you just check the code or did you also test an e-mail?

I've reviewed the code and tested emails in English, Japanese, and French since those are the test languages I've setup. They seam to be sending fine as long as the email subject and body do not contain anything except for the language key. Even a space will break the matching behavior. This will get a lot easier with CB 3.x as on Joomla 4 and 5 we'll just be using Email Templates.

Maybe both problems are related to Joomla! 3

That's a possibility. We don't test Joomla 3 anymore. While we do support it in a legacy sense it doesn't receive testing anymore. So it's possible it's just an issue with how Joomla handles languages on Joomla 3. Currently we officially test "last 2 major" for Joomla, which is Joomla 4 and 5. At this point everyone really really needs to be moving up to Joomla 4 and minimum. CB 3.x will be discontinuing Joomla 3 support though (as in won't even install on J3).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum