Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add styling for login-related emails #38

Open
sminnee opened this issue Aug 5, 2019 · 3 comments
Open

Add styling for login-related emails #38

sminnee opened this issue Aug 5, 2019 · 3 comments

Comments

@sminnee
Copy link
Member

sminnee commented Aug 5, 2019

The 'lost password' email is another thing often forgets to have styling applied.

It would be great if this module provided a nice lost password email too, and any other emails that are generated by default by our login system.

@NightJar
Copy link
Contributor

NightJar commented Oct 6, 2019

To be clear @sminnee you mean the email itself, not the form to request the email, yes?

@sminnee
Copy link
Member Author

sminnee commented Oct 6, 2019

That is correct.

@kinglozzer
Copy link
Member

For now it’s possible to use your own email templates & styles by adding to the themes list in EnablerExtension as described in the readme, but in my case this breaks a bunch of the form styles because the theme also adjusts form templates. My workaround until email templates are added to this module is to override the themes list just before sending the email (this is the closest hook I could find!):

SilverStripe\Security\MemberAuthenticator\LostPasswordHandler:
  extensions:
    - App\Extensions\Security\LostPasswordHandlerExtension
<?php

namespace App\Extensions\Security;

use SilverStripe\Core\Extension;
use SilverStripe\View\SSViewer;

class LostPasswordHandlerExtension extends Extension
{
    public function forgotPassword()
    {
        $themes = SSViewer::get_themes();
        $themes = ['default'] + $themes;
        SSViewer::set_themes($themes);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants