<?php
App::uses('AppController', 'Controller');
/**
 * SendMails Controller
 *
 * @property SendMail $SendMail
 */
class SendMailsController extends AppController {


/**
 * admin_index method
 *
 * @return void
 */
	public function admin_index() {
		$this->SendMail->recursive = -1;
		
		$this->FilterResults->addFilters(
			array(
				'filter_email' => array(
					'SendMail.email' => array(
						'operator' => 'like',
					)
				),
				'filter_template' => array(
					'SendMail.template_mail' => array(
						'operator' => '=',
						'select' => $this->FilterResults->select('Selecione o Template', array(
							'bmtelecom' => 'BmTelecom',
						))
					)
				),
			)
		);
		
		$this->FilterResults->setPaginate('order', 'SendMail.created DESC');
		$this->FilterResults->setPaginate('conditions', $this->FilterResults->getConditions());
		$this->FilterResults->setPaginate('limit', 10);
		
		$this->set('sendMails', $this->paginate());
	}

}
