I have around 200 hundred users for an intranet setup on the Craft Users section all as pending status. Is there a way to send an activation email en-mass to all pending users? Rather than having to run through each user one at a time.

The system is set to change over and each user will need to verify their account and set their password, but they've been added to the system in advance and need to be sent an activation email out of hours so that they Intranet system changes overnight and they have an email waiting for them the next day they step into the office.

1 Answer 1

foreach(\craft\elements\User::find()->status('pending')->all() as $user){ 

Fetch all pending users and send them the mail

  • 1
    To clarify for anyone landing here via Google: the solution here is a code snippet to be applied as a plugin - which you'd need to make yourself. There is no built in action in the CMS to do as requested, and the above line is not Twig code to be put in a template. Jul 2, 2018 at 8:05
  • @MattWilcox To clarify, it can be done in Twig as well Jul 2, 2018 at 8:06
  • What is the alternative solution in Twig or via control panel? I am also looking for this solution. Jan 16, 2020 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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