Overwrite authentication templates from package



I am Trying to overwrite some authentication templates from a package. I have found (or rather not found) few infos on the web. The documentation speaks about “overwriting (almost) any core file” but then leaves me in the dark what the exeptions are.

So basically i want to overwrite the “forgot password” MailTemplate from my Package. I created ‘forgot_password.php’ in ‘package/mail’, that did not work. I then copied the concrete authentication controller to ‘package/authentication/concrete/controller.php’ and specified the mail template: $mh->load(‘forgot_password’, ‘package_handle’) but that controller also does nothing.

I can specify the package in the $mailhelper->load(‘template’) call in the controller on the concrete folder, that works but is no solution for a deployed app.

How to have any control over the concrete -authentication? At the moment even the translated text for the mail is not respected from my translation files (all the other translations work)

(i also tried to overwrite the login form somehow, did not work and i could do what the client wanted via css+js)

thanks & kind regards

Is it possible to override it at the application level? If so, it’s quite easy to just copy /concrete/mail/forgot_password.php to /application/mail/forgot_password.php and then modify that file. Concrete will detect that file and use it instead of the core file.

If you want to do it at the package level, you will need to replace the controller that tries to send the mail in the first place (in this case, /concrete/authentication/concrete/controller.php).

You can override classes very easily with something like:

$app->bind(StatusService::class, CustomStatusService::class)

For translating the email, it does look like the translate site interface does not pick up the t() string in /concrete/mail/forgot_password.php for some reason. However, it does find it if you copy it to /application/mail: