當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SendPress_Option::get_sender方法代碼示例

本文整理匯總了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;
 }
開發者ID:richardsweeney,項目名稱:sendpress,代碼行數:28,代碼來源:class-sendpress-sender-spnl.php


注:本文中的SendPress_Option::get_sender方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。