I’ve configured real SendGrid credentials in
trellis/group_vars/development/mail.yml because I want to use them with the SendGrid SMTP API in a plugin I’m developing. Now regular email sent by Wordpress is no longer being intercepted by Mailhog, I guess because the configured smtp server is no longer
My understanding based on the Trellis docs was that Mailhog could still intercept mail in development even when real credentials were supplied.
From the docs
“Another benefit of using MailHog is that if are using real SMTP credentials in development, you can ensure you don’t accidentally send emails to real email addresses which might exist in your database.”
Is what I’m trying to do possible or just crazy?
Did you happen to get a chance to look into this?
When features in Trellis are connected to ansible-galaxy roles, it’s good to consult the role’s docs as these will be more up to date and comprehensive than what we can maintain in the Trellis docs.
Mailhog works on a catch and release basis. So when you have an email you want to send from dev to your smtp gateway, you open Mailhog, select release on the appropriate mail and enter in the settings for your live smtp gateway.
You can also set up the details via ansible (copied from the ansible-role-mailhog docs) :
Whether or not this role should additionally install ssmtp (which will replace any existing sendmail binary). If set to false, none of the ssmtp_* variables will have an effect.
Thanks, this clarifies what looks like just my misunderstanding of that line in your docs and inexperience with Mailhog and SMTP. I really appreciate the response.