Ejemplo n.º 1
0
	/**
	* Initialize
	*/
	public function __construct()
	{
		if (class_exists('Mail_Postmark_Adapter')) {
			require_once('Adapter_Interface.php');

			$reflection = new ReflectionClass('Mail_Postmark_Adapter');

			if (!$reflection->implementsInterface('Mail_Postmark_Adapter_Interface')) {
				trigger_error('Mail_Postmark_Adapter must implement interface Mail_Postmark_Adapter_Interface', E_USER_ERROR);
			}

			$this->_apiKey = Mail_Postmark_Adapter::getApiKey();

			Mail_Postmark_Adapter::setupDefaults($this);

		} else {
			if (!defined('POSTMARKAPP_API_KEY')) {
				trigger_error('Postmark API key is not set', E_USER_ERROR);
			}

			$this->_apiKey = POSTMARKAPP_API_KEY;

			if (defined('POSTMARKAPP_MAIL_FROM_ADDRESS')) {
				$this->from(
					POSTMARKAPP_MAIL_FROM_ADDRESS,
					defined('POSTMARKAPP_MAIL_FROM_NAME') ? POSTMARKAPP_MAIL_FROM_NAME : null
				);
			}
		}

		$this->messageHtml(null)->messagePlain(null);
	}