2017 © Pedro Peláez
 

library email-roundtrip-monitor

E-mail Roundtrip monitor package

image

kristiani/email-roundtrip-monitor

E-mail Roundtrip monitor package

  • Monday, August 7, 2017
  • by KristianI
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

email-roundtrip-monitor

Simple PHP email round trip monitoring tool., (*1)

Has IMAP support for validating that e-mails are received., (*2)

The test e-mails should be sent through the e-mail method that is usual used in your project (passed as a callback function)., (*3)

Installation

composer require kristiani/email-roundtrip-monitor, (*4)

Usage

You would like your set-up to consist of two cron jobs, (*5)

  1. The cron that sends a test e-mail. The cron can be run e.g. every 15 minutes., (*6)

  2. The cron that checks the test e-mail is received within an tolerated interval. The cron can be run e.g. every 5 minutes. It's convenient to let a 3rd party service (e.g. uptimerobot.com) pull this check instead of a local cron., (*7)

Sending cron

\Roundtripmonitor\Config::$receiverEmail = 'testmailbox@receiver.com';

\Roundtripmonitor\Send::email(function($toName, $toEmail, $fromName, $fromEmail, $subject, $body) {
    yourEmailFunction($toName, $toEmail, $fromName, $fromEmail, $subject, $body);
});

Receiving cron

If you would like your receiving cron to return status code 500 on failure:, (*8)

\Roundtripmonitor\Config::server('imap.host.com', 143, 'imapUsername', 'imapPassword', 'INBOX');
\Roundtripmonitor\Confirm::emailOrFail();

If you prefer to handle your exceptions by yourself:, (*9)

try {
    \Roundtripmonitor\Config::server('imap.host.com', 143, 'imapUsername', 'imapPassword', 'INBOX');
    \Roundtripmonitor\Confirm::email();
} catch (\Exception $ex) {
    // do something about it
}

Change settings

You can change all settings in Config.php individually, e.g., (*10)

\Roundtripmonitor\Config::$alertThresholdTime = 900;

The Versions

07/08 2017

dev-master

9999999-dev

E-mail Roundtrip monitor package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kristian Just Iversen

08/02 2017

0.1

0.1.0.0

E-mail Roundtrip monitor package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kristian Just Iversen