2

I would like to create a language override for both site and administrator. The language constant I am changing is;

RSFP_REG_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY

The content of this is;

Hello %s,\n\nYour account has been activated by an administrator. You can now login at %s using the username %s and the password you chose while registering.

I would like to include my site details in this message. e.g.

Hello %s,\n\nYour account has been activated by an administrator. You can now login at %s using the username %s and the password you chose while registering.\n\ [site name] [site url] [site email address]

Is there any way I can include these so they are dynamic, i.e they change when I edit them in the site global settings? Or do I need to change this language constant every time I change my site details?

2

You could probably only create such dynamic language strings with a custom plugin. You will probably need a system plugin that is triggered by the event onBeforeRender or onAfterRender.

When that event is triggered, your plugin should look for the contents of RSFP_REG_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY and replace it with the same + the extra information.

Edit: I searched for the language string and noticed that it's used by the UsersModelRegistration /components/com_users/models/registration.php That Model has a function JPluginHelper::importPlugin('user'); that loads the User plugins. So I would start looking if there are any User Plugin events that you can hook into.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.