Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Recipes Automatic Debug transport

joebeeson edited this page Jun 21, 2011 · 1 revision

This recipe will make sure that your emails will be fired off through the Debug transport when you're busy working on your application so you don't end up firing off emails to your users.

<?php
// Put this in your AppController class.
public function beforeFilter() {
	if (Configure::read()) {
		$this->Postman->addTransport('Debug');
	}
	parent::beforeFilter();
}

Simple as that. By adding a new Transport object to the component we're also setting it as the active object for mailing.