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

Incorrect registration flash message when email verification is enabled #5213

Open
piotrpog opened this issue Nov 6, 2019 · 3 comments
Open

Incorrect registration flash message when email verification is enabled #5213

piotrpog opened this issue Nov 6, 2019 · 3 comments

Comments

@piotrpog
Copy link

@piotrpog piotrpog commented Nov 6, 2019

If email verification is enabled, after user registers using frontend form, "user registered" flash message is still displayed - instead of something like "please check your email to confirm account".

@brandonkelly

This comment has been minimized.

Copy link
Member

@brandonkelly brandonkelly commented Nov 7, 2019

Technically they were registered successfully so the notice is accurate, but perhaps we should just start letting the form define what the success message should be, similar to what we recently did for Craft Commerce: craftcms/commerce@427ddb0

@piotrpog

This comment has been minimized.

Copy link
Author

@piotrpog piotrpog commented Nov 7, 2019

@brandonkelly
How can i display some additional message then? I tried this code in craftmodule but it didnt worked

Event::on(
    User::class,
    User::EVENT_AFTER_SAVE,
    function(ModelEvent $event) {
          Craft::$app->getSession()->setNotice('x');
    }
);
@brandonkelly

This comment has been minimized.

Copy link
Member

@brandonkelly brandonkelly commented Nov 7, 2019

In the meantime the easiest way to do it would be using static message translations. For example create a translations/<language>/app.php file (replace <language> with your site’s language code, e.g. en-US), and give it this code:

<?php

return [
    'User registered.' => 'Please check your email to confirm account.',
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.