I like the way the mailhog is set up on development by default to capture any mails sent by the server. I feel that staging needs a similar capture setup. If we copy the db from production to staging (or vice versa) we don’t want every user of the website getting the same email twice.
I can see two solutions:
- add mailhog to staging
- give staging different smtp details to production
However, in both cases, staging is no longer identical to production, which isn’t ideal.
Personally I would go with 2, but Trellis uses the same smtp details for both staging and production, which suggests to me that having 2 sets of details should be avoided.
Is there another way? It seems you would need a transactional mail service that allowed you to capture emails based on a rule (source IP address?) but let everything else through. Does anyone know of a service with this feature? Or have any other ideas for a solution?