<?php
/*
  MailBeez Automatic Trigger Email Campaigns
  http://www.mailbeez.com

  Copyright (c) 2010, 2011 MailBeez

  Licensing Terms & Other Conditions of this
  Mailbeez PRO Module:

  Unless you have our prior written consent, you must NOT directly or indirectly license,
  sub-license, sell, resell, or provide for free or make an offer to do any of these things.
  All of these things are strictly prohibited with this MailBeez Pro Module.

  One Purchase for one Shop - please contact cord@mailbeez.com for volume discounts and
  reseller agreements.

  OpenSource but not free - please respect this license agreement.

 */

require_once(MH_DIR_FS_CATALOG . MH_ROOT_PATH . 'common/functions/email_engine_php_mailer.php');
require_once(MH_DIR_FS_CATALOG . MH_ROOT_PATH . 'common/classes/mailbeez.php');
require_once(mh_cfg('MH_DIR_CONFIG') . 'config_email_engine.php');

//$t = microtime(true);

$connectionTest = config_email_engine::connection_test();

//$p = microtime(true) - $t;
//echo $p ;

$common_plugin_actions = mb_admin_button(MAILBEEZ_MAILHIVE_URL . 'test&module=mailbeez_phpmailer_test', mh_lng('MAILBEEZ_BUTTON_SEND_TESTMAIL'));

$common_plugin_actions = ($connectionTest) ?  mailbeez::formatStatusMsg(mh_lng('MAILBEEZ_EMAILENGINE_CONNECTION_OK', 'OK'), 'success') : mailbeez::formatStatusMsg(mh_lng('MAILBEEZ_EMAILENGINE_CONNECTION_FAILED', 'FAILED'));


$contents[] = array('text' => '<div class="mb_action_box">' . mh_image(MH_ADMIN_DIR_WS_IMAGES .'icon_test_32.png', '', '32', '32', 'align="right" style="margin-bottom: 10px; margin-left: 5px; margin-right: 10px;"') . '
        <div class="mb_action_box headline">' . mh_lng('MAILBEEZ_EMAILENGINE_CONNECTION_HEADLINE') . '</div>
        <div class="mb_action_box text">' . mh_lng('MAILBEEZ_EMAILENGINE_CONNECTION_TEXT') . '</div>
        <div class="mb_action_box buttons" style="clear: both"><div align="center">' . $common_plugin_actions . '</div></div>
        </div>');

