Jump to content

Stop all email notifications during testing?

Featured Replies

Posted

We're performing a test migration from vBulletin to IPB. We will then spend a few weeks doing some testing with a small group of volunteers. During this period, we want to ensure that no email notifications are sent out. For example, if we reply to an old thread, in our private testing area, we don't want it firing off 'new reply' emails. Any ideas? 

Quote

Email Debugging

You can write full email logs to disk. If you need to debug the emails being sent from the Community, you can create a folder (example here named _mail) with appropriate write permissions in your Community root directory, and then add in your constants.php (editing the example path provided):


define( 'EMAIL_DEBUG_PATH', "/full/path/to/the/folder/_mail" );

This will cause every email that is sent to be logged to a flat file under this _mail folder. The email will not actually be sent. You should not leave this on for long, especially on a production forum as it can generate a lot of logs.

  • The emails will not be delivered to the recipients
  • The files written are in plain text, and viewable via a web browser if you know the correct URL
  • A high-traffic forum can generate many hundreds or thousands of debug files in a day

The debug switch is useful to determine the raw contents of the email being sent to identify any problems, and to confirm the emails you expect to send are being generated and passed to the mail transport agent.

 

  • Author

Thanks @newbie LAC - that's probably going to be our best bet. There's no option just to not send them and not log them is there? We don't really need the logging at this stage.

You can disable notifications on ACP

disnotif.thumb.jpg.cd4c5051a1cd2078a3183507fbed6887.jpg

I wasn't aware of the email debug switch, but an alternative is a fake SMTP server like this one: https://mailtrap.io. Should save you from dealing with logs, and you can still see the emails if you want.

Edited by evandixon

  • Author
1 hour ago, Daniel F said:

You could also use the email debug path and store the emails in dev/null or your php temp directory ?

I used


define( 'EMAIL_DEBUG_PATH',   sys_get_temp_dir() );

until I switched to https://mailcatcher.me/

Thanks, having read the guide I created a 'constants.php' in our install's root and the contents now read as follows:

<?php

define ('EMAIL_DEBUG_PATH', "/dev/null");

Is that it? Do I need to close the PHP tag? Is there anyway of confirming if mail is *not* being set? lol

You do not need to close the PHP tag.

If you are outputting to /dev/null then no, you can't really confirm. ? You could use a real path at first to test, then switch it back to /dev/null.

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.