I notice that there's a defined constant that is never used - CONTENT_PROFILE_CREATE_USER_SEND_EMAIL
I assume this was intended from the start to limit whether a welcome email is sent or not when a user is created so I'll use this in my patch. I'll mark this as a feature request.
In my current use case, we're using Feeds to migrate user accounts from an old system we're deprecating to Drupal and we're storing most of the users' data as Content Profile nodes in Drupal. We'd like to bulk generate Drupal user accounts from this information, but for various reasons don't want to email every single user in the list about their newly created accounts.
The main reason being that the accounts are of various ages, some as much as 5 years old, and we don't want to "spam" the whole list first during dev, then testing, then once more when we go to production. Even after we're in production, we'll have to do a fair bit of re-training over a period of time for the new users and want to walk them through the process with their pre-created new accounts rather than confuse them with an unsolicited email right off the bat.
Once we have done the initial bulk generation, we'll want to then go back to automatically sending welcome emails for new nodes that are generated through the feed importer and then converted individually, so I'd prefer to turn this into a setting rather than just hack the mailing function directly.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1462384-option-to-not-send-welcome-emails-1.patch | 2.52 KB | thedavidmeister |
Comments
Comment #1
thedavidmeister commentedpatch attached
Comment #2
ianwremmel commentedI committed this patch with the slight alteration that sending emails is disabled by default.
Also, below is the method I use to prevent php from sending emails off of my testing machine. The script will redirect all mail to the specified email address.
Place the following script in /usr/local/bin/trapmail and make it executable. Then, change the value of the "sendmail_path" path variable in php.ini to "/usr/local/bin/trapmail". Of course, make sure to change the email address to one you can access. The script was written for Centos, so it's possible that paths will be slightly different on other flavors of Linux.
Comment #3
ianwremmel commented