Jump to content

Community

KT Walrus

Router for all emails when in test mode

Recommended Posts

I'd like to see a Test Mode option in the ACP that I can enable, regardless of whether I am IN_DEV or not that causes all outgoing email messages to be sent as PMs to the Admin (or some other internal list). This new Test Mode might also enable other features that help testing a site before deployment.

I've configured a bunch of dummy test users on my site (that isn't open for real user registration yet), and I don't want to have to make up real test email addresses for each user to receive notification and respond to them (like account verification emails).

I suppose there might be another fix I can do when testing my site before deployment, but this one seems like the easiest solution to me at this time.

I'm open to reading about any other ways people have tested their sites before deployment since I'm adding a bunch of user visible changes for my new site that will require thorough testing before opening the site to real users. There might be a better way that I just don't know about instead of adding a new feature in the ACP.

Share this post


Link to post
Share on other sites
4 hours ago, Nathan Explosion said:

See 'Email Debugging' section

Thanks. I try this out. The only issue I have with dumping to the file system on the server is that I won't be able to view in HTML easily unless I download and import them into my email app somehow. Then I can simply click on any verification links or other user actions that might be taken from viewing this notification message in HTML. I suppose I could pipe them into the database and route them to a Support area to view them as HTML.

Maybe the process of responding to simulated email is easier than I think. If not, I would request an extra switch to route them as a PM to the admin or forward them to my email address.

I also thought of trying to make fake email address for my real email address by using a '+' in my real email address. Some mail services will allow delivery of username+fakename@gmail.com. Probably Gmail supports this and I can just register fake '+' addresses for each of my fake test users.

Anyone else have any experience/advice at/for deploying to production and doing adequate testing in a staging environment before pushing to production?

Share this post


Link to post
Share on other sites

Thanks. I had thought of something similar months ago, but I don't develop for IPS that often and had forgotten all about that option (to use a email forwarding service). 

I have forgotten the name of this free forwarding service (and still don't remember), put they allowed you to simply point a domains MX DNS records to their email forwarding service, and redirect all email to there.

Now that I think of it, I can probably easily configure Postfix on my server to forward all outgoing SMTP mail sent by IPS to forward to any email address I want. All I have to do is change the SMTP settings in the ACP to use this SMTP service and I should be good to go. Right now, I send all email using AWS SES SMTP, but the emails go to real addresses rather than fake ones.

Share this post


Link to post
Share on other sites

FWIW, if I double click on a logged email file, it opens in my email client (HTML formatting and all). You don't generally need to import them (they're saved with .eml extensions which generally get registered to whatever email client you use).

Share this post


Link to post
Share on other sites

FWIW, I ended up using "+" addressing to my real email address (e.g., kevin+mary@gmail.com for the test user Mary) when I create test users. This delivers all email to my INBOX and tell me which test user got the message.

But, this won't work well when my site is live and in production.

So, @bfarber, maybe you could implement an ACP setting which is a stack of email addresses to BCC emails to and a filter for selecting the users/groups that the ACP uses for each BCC email address entered. The filter would direct the ACP on which BCC addresses to add to which outgoing message recipients.

This would greatly help in production. I could define one "archive" gmail address to be BCC'ed on all outgoing emails, and only add another when I want to "monitor" the email for a specific user, list of users, or list of groups. 

The BCC'd INBOX will receive an exact copy of what the real recipient sees, so this would be a great feature for both archiving all outgoing messages and for tracking down a specific issue relating to emails to specific users.

Share this post


Link to post
Share on other sites

I think if you need advanced statistics and the ability to retain and review sent emails, you might be best off using a third party service such as Sendgrid.

Share this post


Link to post
Share on other sites

Don't want to use something like Sendgrid since I'm concerned enough about my users privacy to try not to add and 3rd party services that expose user activity to the 3rd party who does whatever they want to with personal data.

I don't also use Google or even any IPS services (like the SPAM service) since I don't want 3rd parties to see any personal data for my users, if I can help it.

BTW, I implemented a pretty good solution to this problem today:

  1. 2 app settings, one for debugging and one for archiving email with the following syntax:
    • bcc=username@gmail.com,uid=*|<id1,id2,id3,...>,g=*|<gid1,gid2,...>
  2. a plugin in my app to check the primary recipient in an outgoing email message against either of these settings and adding the BCC if match

Not much to it, but it should allow me to archive all outgoing emails to a dedicated gmail address and debug tracing to my real address on specific users outgoing emails when my site has real users and I need to track down an issue related to outgoing emails.

BCC is great for routing email to private email INBOXes without exposing these addresses to the real recipients.

 

 

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy