本文整理汇总了PHP中SendPress_Option::get_sender方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Option::get_sender方法的具体用法?PHP SendPress_Option::get_sender怎么用?PHP SendPress_Option::get_sender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SendPress_Option
的用法示例。
在下文中一共展示了SendPress_Option::get_sender方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_email
function send_email($to, $subject, $html, $text, $istest = false, $sid, $list_id, $report_id)
{
//$user = SendPress_Option::get( 'mandrilluser' );
//$pass = SendPress_Option::get( 'mandrillpass' );
$from_email = SendPress_Option::get('fromemail');
//$hdr = new SendPress_SendGrid_SMTP_API();
$m = SendPress_Option::get_sender('sendpress');
//$hdr->addFilterSetting('dkim', 'domain', SendPress_Manager::get_domain_from_email($from_email) );
//$phpmailer->AddCustomHeader(sprintf( 'X-SMTPAPI: %s', $hdr->asJSON() ) );
$info = array("X-SP-METHOD" => "WPED.co", "X-SP-LIST" => $list_id, "X-SP-REPORT" => $report_id, "X-SP-SUBSCRIBER" => $sid, "X-SP-DOMAIN" => home_url());
$url = 'https://gateway.wped.co/send/';
//$url = 'http://spnl.dev/';
$verify_ssl = true;
if (isset($m['verifyssl']) && $m['verifyssl'] == 'donotverify') {
$verify_ssl = false;
$url = 'http://api.wped.co/send';
}
$message = array('to' => array(array('email' => $to)), 'subject' => $subject, 'html' => $html, 'text' => $text, 'from_email' => $from_email, 'from_name' => SendPress_Option::get('fromname'), 'headers' => $info, 'inline_css' => true, 'subaccount' => $m['sendpress-key'], 'metadata' => array('sender' => 'SPNL', 'return' => home_url()));
$response = wp_remote_post($url, array('method' => 'POST', 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array('Content-Type' => 'application/json'), 'body' => json_encode($message), 'sslverify' => $verify_ssl, 'cookies' => array()));
if (is_wp_error($response)) {
$error_message = $response->get_error_message();
SPNL()->log->add('WPED Sending', $error_message, 0, 'sending');
return false;
} else {
return true;
}
return false;
}