Deal with the new refracted code.
*/
class mailer
{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /**
+ * Constructor
+ *
+ * This contructor sets up this model. At this time that only includes
+ * storing away the WordPress data object.
+ *
+ * @return object Class object
+ *
+ */
+ public function __construct( $wpdb, $config )
+ {
+ $this->wpdb = $wpdb;
+ $this->config = $config;
+ }
+
/**
* sendHtmlEmail
*
}
wp_mail( $to, $subject, $message, $header );
-
- remove_filter( 'wp_mail_from_name' );
- remove_filter( 'wp_mail_content_type' );
}
/**
require_once GLM_MEMBERS_MESSAGES_PLUGIN_CLASS_PATH.'/data/dataEmailMessages.php';
require_once GLM_MEMBERS_MESSAGES_PLUGIN_CLASS_PATH.'/data/dataEmailTemplates.php';
+require_once GLM_MEMBERS_MESSAGES_PLUGIN_CLASS_PATH.'/mailer.php';
+
+use GlmMessages\mailer as glmMailer;
/**
* GLmMembersFront_event_detail
*/
public $config;
- /*
+ /**
* Constructor
*
* This contructor sets up this model. At this time that only includes
*/
public function modelAction($actionData = false)
{
+ $glmMailer = new glmMailer( $this->wpdb, $this->config );
$view = 'newsletter';
$emailContent = '';
$Templates = new GlmDataEmailTemplates( $this->wpdb, $this->config );
$smarty->templateAssign( $k, $d );
}
}
- $message['message_body'] = $this->fixImages( $message['message_body'] );
+ $message['message_body'] = $glmMailer->fixImages( $message['message_body'] );
$htmlMessage = wpautop( $message['message_body'] );
$emailContent = $smarty->template->fetch( 'eval:' . $htmlMessage );
} else {
*/
public function queueHtmlMessages( $data, $messageId, $sendNow = false )
{
- $glmMailer = new glmMailer();
+ $glmMailer = new glmMailer( $this->wpdb, $this->config );
$message = $this->getEntry( $messageId );
$fromEmail = $message['from_email'];
$fromName = $message['from_name'];