0

We have had a number of occasions when a new new developer starts working on a project, and when they have it installed the cron runs and sends out a load of emails to users. If the database is fairly old this could send out a lot of unwanted mails. What is the best way to prevent this?

We are currently using Reroute Email which works fine, but obviously this is needs to be enabled. We have set up the settings.php to override the config to enable this, but as it's not included in the GIT repo a new developer might not include this when setting up their local version.

Is there any way to lock this down so it can't happen?

  • Either sanitize it and/or install mailhog on the local server – Kevin Nov 17 '17 at 5:06
0

You can sanitize the database so that the emails are not "live" before you provide the database to new developer(s).

drush sql-sanitize is one way to do this.

On my site, I have dev/staging/live servers. When the live/test database is cloned to dev, a script is called that automatically changes all email addresses to uid@mysite.com. And then all developers pull the database from the dev server. This way, it is impossible to accidentally spam users.

I think the only "foolproof" way to prevent accidentally emailing users is to never give the developer the users' emails in the first place.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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