We were recently updating a site that had few hundred Concrete 5 users. As we worked on updates in our dev/test environment, we wanted to keep the user data, but we didn't want the real people accidentally getting emails.
We put together the following query to do a mass change of email addresses. It's a pretty simple SQL statement, but one that we thought others might find useful. Note: as is the norm when updating a database directly, you should make a database backup first in case something goes wrong. Also, you should only be doing this on a non-production version of your site. There's no undo approach described here for bringing back the real email addresses.
UPDATE Users SET uEmail = CONCAT('fake-email-', uID, '@concrete5tricks.com')
This changes email addresses to something like
email@example.com. The use of
uID ensures each email address is unique because the
uID column itself is unique.
If you wanted to actually get emails from the system for these users, you could change everyone to have your email address (I don't think uniqueness ultimately matters unless you're using emails for login). If you use Gmail, you could do something like:
UPDATE Users SET uEmail = CONCAT('dan+', uID , '@concrete5tricks.com');
UPDATE Users SET uEmail = CONCAT('dan+', uName , '@concrete5tricks.com');
This would take advantage of Gmail's "+" feature to create addresses like
firstname.lastname@example.org that would still come to my
These are just a couple of many approaches. Feel free to make it your own and please share if you have other tips to avoid sending real people unintended emails.
In this technique, you might want to avoid using dummy email addresses with random domains like @example.com, @test.com, etc. This may be treading into over-paranoia-territory, but it's easy to set up catch-all accounts. And if your C5 site sends anything sensitive, you might be putting yourself at risk. It'd be better to stick with a domain you own and/or trust.
Commenting has been disabled.