7

I want to be able that users can enter their emailaddress in an input and that the activation link gets resend You'll need to write a plugin, which can generate activation URLs using the UsersService: echo craft()->users->getPasswordResetUrl($user); If you want to send the user an activation email instead of echoing a link in the frontend, you can ...


5

Go to the Users section of the Control Panel (mysite.com/admin/users/). Click on the user account that needs to be activated. Click on the settings cog on the right side (see attached image), and choose which option works for you. Hope this helps!


5

foreach(\craft\elements\User::find()->status('pending')->all() as $user){ Craft::$app->getUsers()->sendActivationEmail($user); } Fetch all pending users and send them the mail


4

This the best article I've read on reliably delivering emails through code: http://blog.codinghorror.com/so-youd-like-to-send-some-email-through-code/


4

You're close! Those config settings are off in no-mans-land right now. If you want them to apply across all of your multi-environment configs, you need to move them into the '*' array like so: return array( '*' => array( 'omitScriptNameInUrls' => true, 'setPasswordPath' => 'user/set-password', '...


3

I'm not sure if the Sprout Email plugin can do anything to help you or not, but I can think of a few options that would involve simple, custom plugins. Every user has a "Require a password reset on next login" that an administrator can set from the CP under their settings. You probably don't want to do that manually for 3,000 users, but a simple plugin (or ...


3

Okay - got to the bottom of this. Was using the wrong setting. Should have been setPasswordSuccessPath not setPasswordSuccess!


3

(Not necessarily a great answer to your question, but it's in the same wheelhouse and might be handy if you're working in this area)! I remember having issues with this myself (to be honest the precise details are a bit lost in time for me - but basically IIRC it's by design that they're not logged in after creation, perhaps to force them to practise login/...


3

It looks like the config setting activateAccountFailurePath is what you are looking for.


3

Some sort of workaround You can make a register user group with no permissions. Than add another group with the permissions you want. After registration, the admin can put a new user to the new group.


2

You could do this in a plugin by listening for some user-related events. In particular, onBeforeActivateUser, where you could cancel user activation by setting $event->performAction = false;


2

Probably this has been fixed since this old question, but just wrapping {{link}} variable in <a> tag lets me send custom HTML notifications with working clickable text links. Screenshot of messages settings: Screenshot of custom HTML email received: Perhaps this won't work for the text version of the email, but if needed I suggest you to use this ...


2

In Craft 2.x, it isn't possible for plugins to provide their own email providers that the entire Craft installation can use. They can provide their own that they can use for themselves, but it won't affect things like when Craft sends an activation email. That's changed in the upcoming Craft 3, though. There is an example Mandrill plugin here on how to ...


2

You'll need to save the new user before you can activate them. This code should do the trick: if (craft()->users->saveUser($newUser)) { craft()->users->activateUser($newUser); }


2

You can write a plugin that listens to the users.onActivateUser event, and manually redirects the browser to your desired page. Just add this code to your plugin’s primary class: public function init() { craft()->on('users.activateUser', array($this, 'onActivateUser')); } public function onActivateUser(Event $event) { /* @var UserModel $user */ ...


2

Just to add; we are apparently seeing this issue too. Or to be more clear: we haven't seen it ourselves, but our client keeps getting reports from their customers that Activation links are not working - giving "error messages" when clicked. We've then had the trouble mail forwarded to us, we've clicked the link, and it's been fine. Looks like there is some ...


2

Turns out this was a bug in Craft that's been fixed for the next (post 2.3.2629) release.


2

They could already be active Users Their activation link could have timed out 1) happens more often than I'd think, people try using it as a way of "getting to the site again" 2) Can be controlled in /config/general.php - https://craftcms.com/docs/config-settings#verificationCodeDuration


2

Generally best practice is to look into the source code and see what happens in the function /** * Manually activates a user account. Only admins have access. * * @return null */ public function actionActivateUser() { $this->requireAdmin(); $this->requirePostRequest(); $userId = craft()->request->getRequiredPost('userId'); $...


2

You can get the user by email {% set user = craft.users.status(null).email("a@b.de").one() %} {{ user.id?? 'no user found' }}


1

After a little more work, I came up with this approach that works- First, I unchecked the verify email addresses option in the user settings. Then, I added another trigger in my custom module- on before user save- that sets the new user's status to pending. The two triggers combined produce the functionality I'm looking for: Event::on( User::...


1

Thanks to @BradBell - I just needed to use the Admin setting. Seems like you just want to uncheck "Verify Email Addresses?" under >Settings->Users->Settings


1

Figured it out by debugging getSiteUrl in UrlHelper. Setting siteUrl like 'siteUrl' => strtolower((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://' : 'http://') . $_SERVER['SERVER_NAME']) is fine for browser requests, but $_SERVER['SERVER_NAME'] isn't available when running a console command. The scheme is set correctly and ...


1

After following the stack trace for activating a user (with the link), I discovered that activation fails at /craft/app/services/UsersService.php:822: 820: public function verifyEmailForUser(UserModel $user) 821: { 822: if ($user->unverifiedEmail) 823: { Apparently I needed to set the unverifiedEmail property when creating "Pending" users ...


1

Add 'autoLoginAfterAccountActivation' => true to config/general.php


1

Solved - bizarre one this. Was using a third-party email service via SMTP and it was manipulating the URL somehow. Switching to use a direct SMTP connection with a specific email account has resolved. Go figure!


1

Ok, i found the Email "Message" settings where the wrong markers where ("craft_link" instead of "link" etc.) located.


1

There currently aren't any verification events, but if the user is in a pending state (i.e. they haven't been activated yet), verification will trigger activation, which triggers the onBeforeActivateUser and onActivateUser events.


1

In your config, you can set activateAccountFailurePath to something like: 'activationAccountFailurePath' => 'members/failed?access=1' In your template, you can check for the URL parameter 'access' and 404 if it is not set. Template: {% if craft.request.getParam('access') != '1' %} {% exit 404 %} {% endif %} {# rest of your template if parameter is ...


1

This has been changed on the upcoming Craft 2.3 release such that if the system status is set to off, account verification and set/forgot password logic will still run.


Only top voted, non community-wiki answers of a minimum length are eligible