* Link: http://seemslegit.com
* License: GPLv2
* Description: Provides an interface for sending and receiving mail.
*/
class Mail extends SimpleExtension {	
	public function onSetupBuilding($event) {
		$sb = new SetupBlock("Mailing Options");
		$sb->add_text_option("mail_sub", "
Subject prefix: ");
		$sb->add_text_option("mail_img", "
Banner Image URL: ");
		$sb->add_text_option("mail_style", "
Style URL: ");
		$sb->add_longtext_option("mail_fot", "
Footer (Use HTML)");
		$sb->add_label("
Should measure 550x110px. Use an absolute URL");
		$event->panel->add_block($sb);
	}
	
	public function onInitExt($event) {
		global $config;
		$config->set_default_string("mail_sub", $config->get_string("site_title")." - ");
		$config->set_default_string("mail_img", make_http("ext/mail/banner.png"));
		$config->set_default_string("mail_style", make_http("ext/mail/mail.css"));
		$config->set_default_string("mail_fot", "".$config->get_string("site_title")."");
	}
}
class MailTest extends SimpleExtension {
	public function onPageRequest($event) {
		if($event->page_matches("mail/test")) {
			global $page;
			$page->set_mode("data");
			echo "Alert: uncomment this page's code on /ext/mail/main.php starting on line 33, and change the email address. Make sure you're using a server with a domain, not localhost.";
			/*
			echo "Preparing to send message:
";
			echo "created new mail object. sending now... ";
			$email = new Email("example@localhost.com", "hello", "hello world", "this is a test message.");
			$email->send();
			echo "sent.";
			*/
		}
	}
}
?>