protected function _configSender($data = []) {
		$defaultData = [
			'config' => null,
			'from' => null,
			'to' => null,
			'subject' => null,
			'template' => null,
			'vars' => null,
			'helpers' => null,
			'emailFormat' => null];
		$data = (array)$data + $defaultData;
		extract($data, EXTR_OVERWRITE);

		if (empty($to) || empty($template)) {
			return false;
		}

		if (empty($config)) {
			$config = 'default';
		}
		if (empty($from)) {
			$domain = parse_url(Configure::read('App.fullBaseUrl'), PHP_URL_HOST);
			if (empty($domain)) {
				$domain = 'localhost';
			}
			$from = 'report@' . $domain;
		}
		if (empty($subject)) {
			$subject = $from;
		}
		if (empty($helpers)) {
			$helpers = [];
		}

		if (!is_array($template)) {
			$template = [$template];
		}
		if (!is_array($helpers)) {
			$helpers = [$helpers];
		}

		$default = [
			'template' => [
				false,
				'CakeNotify.default'
			],
			'helpers' => [
				'Html',
				'Text',
				'CakeNotify.Style'
			],
		];

		$template = $template + $default['template'];
		$helpers = array_values(array_unique(array_merge($default['helpers'], $helpers)));
		if (!empty($helpers)) {
			$helpers = [$helpers];
		}

		if (empty($emailFormat)) {
			$emailFormat = 'both';
		}
		$mailData = [
			'settings' => compact('config', 'from', 'to', 'subject', 'template', 'helpers', 'emailFormat'),
			'vars' => $vars
		];

		return $mailData;
	}
protected function _configSender($data = []) {
		$defaultData = [
			'config' => null,
			'from' => null,
			'to' => null,
			'subject' => null,
			'template' => null,
			'vars' => null,
			'helpers' => null,
			'emailFormat' => null];
		$data = (array)$data + $defaultData;
		extract($data, EXTR_OVERWRITE);

		if (empty($to) || empty($template)) {
			return false;
		}

		if (empty($config)) {
			$config = 'default';
		}
		if (empty($from)) {
			$domain = parse_url(Configure::read('App.fullBaseUrl'), PHP_URL_HOST);
			if (empty($domain)) {
				$domain = 'localhost';
			}
			$from = 'report@' . $domain;
		}
		if (empty($subject)) {
			$subject = $from;
		}
		if (empty($helpers)) {
			$helpers = [];
		}

		if (!is_array($template)) {
			$template = [$template];
		}
		if (!is_array($helpers)) {
			$helpers = [$helpers];
		}

		$default = [
			'template' => [
				false,
				'CakeNotify.default'
			],
			'helpers' => [
				'Html',
				'Text',
				'CakeNotify.Style'
			],
		];

		$template = $template + $default['template'];
		$helpers = array_values(array_unique(array_merge($default['helpers'], $helpers)));
		if (!empty($helpers)) {
			$helpers = [$helpers];
		}

		if (empty($emailFormat)) {
			$emailFormat = 'both';
		}
		$mailData = [
			'settings' => compact('config', 'from', 'to', 'subject', 'template', 'helpers', 'emailFormat'),
			'vars' => $vars
		];

		return $mailData;
	}
protected function _configSender ( $ data = [ ] ) { $ defaultData = [ 'config' => null , 'from' => null , 'to' => null , 'subject' => null , 'template' => null , 'vars' => null , 'helpers' => null , 'emailFormat' => null ] ; $ data = ( array ) $ data + $ defaultData ; extract ( $ data , EXTR_OVERWRITE ) ; if ( empty ( $ to ) || empty ( $ template ) ) { return false ; } if ( empty ( $ config ) ) { $ config = 'default' ; } if ( empty ( $ from ) ) { $ domain = parse_url ( Configure :: read ( 'App.fullBaseUrl' ) , PHP_URL_HOST ) ; if ( empty ( $ domain ) ) { $ domain = 'localhost' ; } $ from = 'report@' . $ domain ; } if ( empty ( $ subject ) ) { $ subject = $ from ; } if ( empty ( $ helpers ) ) { $ helpers = [ ] ; } if ( ! is_array ( $ template ) ) { $ template = [ $ template ] ; } if ( ! is_array ( $ helpers ) ) { $ helpers = [ $ helpers ] ; } $ default = [ 'template' => [ false , 'CakeNotify.default' ] , 'helpers' => [ 'Html' , 'Text' , 'CakeNotify.Style' ] , ] ; $ template = $ template + $ default [ 'template' ] ; $ helpers = array_values ( array_unique ( array_merge ( $ default [ 'helpers' ] , $ helpers ) ) ) ; if ( ! empty ( $ helpers ) ) { $ helpers = [ $ helpers ] ; } if ( empty ( $ emailFormat ) ) { $ emailFormat = 'both' ; } $ mailData = [ 'settings' => compact ( 'config' , 'from' , 'to' , 'subject' , 'template' , 'helpers' , 'emailFormat' ) , 'vars' => $ vars ] ; return $ mailData ; }
Creates a configuration for sending email

@param array $data Data for creating a configuration.
List of key for data array:
- `config`;
- `from`;
- `to`;
- `subject`;
- `template`;
- `vars`;
- `helpers`;
- `emailFormat`.
@return bool|array Return array of configuration, or False on failure.
Creates a configuration for sending email