Would like to ask your opinion - I have a Dev/Testing Server which consists of real vendors/customers data. How can I ensure no real customers/vendors would receive any testing email e.g. low stock notification, order confirmation, etc.

Magento version.

  • Main intention is to ensure that data is dummy or at least not used for sending out emails..... hope anyone can assist :) – Jester xxx Feb 3 '17 at 8:51

The dev/testing data should be anonymized before imported into it to avoid leaking real customer data and also sending emails/notifications to any customers.

There are few tools that are helping do that without much hassle but you could also write a simple module based on Faker library.

From what I've tested and works:

You can also dump the data stripped for development - without any customer/sales data - from live database with n98-magerun command:

n98 db:dump --strip=@development

What above command does it takes care of all tables that shouldn't be moved to a development environment therefore all email queues etc are also purged.

Another solution is to implement a MailCatcher on your dev machine and configure Magento to use it instead of a production email config. This could be easily done with LimeSoda_EnvironmentConfiguration but as I've stated earlier - no real customers data should be exposed on dev environment.

| improve this answer | |
  • 2
    @jesterxxx Please also note that not using real (= identifiable) customer data on test systems is a legal requirement in many jurisdictions (e.g. european union), so it is a good idea anyways, even if you are not sending any mails at all. – Paŭlo Ebermann Feb 4 '17 at 21:03
  • Very important comment from @PaŭloEbermann ^ Consider upvoting it. – versedi Feb 5 '17 at 0:12
  • @PaŭloEbermann - Thanks for your advice. Noted. – Jester xxx Feb 7 '17 at 8:59

You can achieve this through backend side.

Just go to System > Configuration > Advanced > System > Mail Sending Settings. There set Yes to Disable Email Communications option. This will prevent all email which are going through your application.

Hope that helps.

| improve this answer | |
  • Hi Rajeev, thanks for your reply!. By doing so - i still want emails to be sent to my own email address to see how is the mail notification like. Is there a way i can ensure all the vendor's/ customer's data is dummy instead? – Jester xxx Feb 3 '17 at 8:55
  • to do that, probably you need to write some custom code atleast. There is no default option to achieve that. – Rajeev K Tomy Feb 3 '17 at 8:58
  • You can check emails wether with the tool provided under system > transactional emails. If you edit them directly in the source, you can add header and footer to the body to see how they look like. – Christophe Ferreboeuf Feb 3 '17 at 9:03
  • Hi Christophe - thanks for your reply. but it seems not what i was looking for :) – Jester xxx Feb 3 '17 at 9:05
  • also checkout what @versedi suggested. That looks like some awesome tools. – Rajeev K Tomy Feb 3 '17 at 9:05

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.