public function __construct($args = array(), $i = 1)
{
// headers check
if (!empty($args['headers'])) {
self::$headers = self::validate_headers((array) $args['headers'], $i);
}
// get querystring
if (!empty($args['to_email'])) {
self::$querystring = self::get_querystring($args['to_email']);
}
// get userdata from email address
if (!empty($args['from_email'])) {
self::$user = get_user_by('email', $args['from_email']);
}
// set email content
if (!empty($args['content'])) {
self::$content = $args['content'];
}
// set email subject
if (!empty($args['subject'])) {
// Strip line-breaks from subject lines.
self::$subject = str_replace("\r\n", '', $args['subject']);
}
// is the current email HTML-only?
if (isset($args['is_html'])) {
self::$is_html = (bool) $args['is_html'];
}
}