Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

How to refer to language constant within CB language override file?

  • azjr
  • azjr
  • OFFLINE
  • Posts: 99
  • Thanks: 10
  • Karma: 2
8 years 6 months ago #280793 by azjr
Yes - all set as needed - it drove me crazy :) - I started to substitute different links (like facebook, etc. ) in that space, and all were "broken in half" - after some though: I have removed all the spaces from the html output so the entire email was one big line - since whatever I entered there, was "broken" into the next line - I pushed the entire <a href= tag into new line... it worked... :) I'm wondering if I exceeded allowed amount of characters per line and system automatically forced me to the next one... - not sure, but that's my best guess after seeing the results. - thanks for brainstorming with me :)

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

  • azjr
  • azjr
  • OFFLINE
  • Posts: 99
  • Thanks: 10
  • Karma: 2
8 years 6 months ago #280835 by azjr
Kyle - a quick follow up question, in part referring to this ticket: www.joomlapolis.com/forum/153-professional-member-support/230201-cb-invites-usage

In invites plugin > Parameters > Email Tab > either body header or footer: if I enter link with language constant like this <a href="<?php echo JText::_('LANGUAGE_CONSTANT') ; ?>"> - will this work?
Thanks!

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

  • azjr
  • azjr
  • OFFLINE
  • Posts: 99
  • Thanks: 10
  • Karma: 2
8 years 6 months ago #280840 by azjr
Kyle: I need to parse a html content (template) for the username reminder email (UE_USERNAMEREMINDER_MSG in CB language file -> cloned to overrides) - as well as into the password reset email.
I tried to do the same as in i.e. YOUR_REGISTRATION_IS_PENDING_APPROVAL_MESSAGE - but I'm getting empty email if I enter full html template (escaped " and ' with \" and \')

On another note: I'm kind of surprised that neither Joomla nor CB or in that matter any other component that I ran into doesn't implement a way for a global, company-branded email template - where you can define your header - body - footer and all the messages that are then listed across the entire website use that main template. It is quite ridiculous to enter for every single language email body string the entire email template, over and over - quite irritating. Hope you don't mind my venting :)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 6 months ago #280866 by krileon

In invites plugin > Parameters > Email Tab > either body header or footer: if I enter link with language constant like this <a href="<?php echo JText::_('LANGUAGE_CONSTANT') ; ?>"> - will this work?

No, you can't use PHP there nor can you use language strings inline. You need to translate the entire string. Example as follows.

Header: MY_INVITE_HEADER
Language String:
Code:
'MY_INVITE_HEADER' => 'HTML/PHP/WHATEVER HERE',

Kyle: I need to parse a html content (template) for the username reminder email (UE_USERNAMEREMINDER_MSG in CB language file -> cloned to overrides) - as well as into the password reset email.
I tried to do the same as in i.e. YOUR_REGISTRATION_IS_PENDING_APPROVAL_MESSAGE - but I'm getting empty email if I enter full html template (escaped " and ' with \" and \')

Do not include a body tag or anything of the sort. Just supply your HTML properly escape for PHP in your language string. Body is already handled by the mailer.


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.
The following user(s) said Thank You: nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum