drush – Bulk user creation and email notification

This is probably not the “right” way to do this, but it solved my problem.

Drush wont email on your behalf but it will generate the one time link.

You can see details here, the basic format is:

drush user:login --mail=user@example.org

One downside is that the link generated appears to not use the name of the domain generating it. So instead of links starting with https://my=site.com/user...
you get:
http//default/user

There is probably some environmental variable that could be changed to fix this but it seemed easier to just cut the first 13 chars with a script and replace them with the correct domain.

If you’re bulk importing you can have whatever script you have written to submit the new users also generate this link and then re-write it correctly before outputing it all to a csv file (or format of your choice.)

Then you can create your own emails in whatever bulk email system you wish with a mail merge.

This solution is not ideal but it is reasonably quick and easy and not a lot can go wrong.