当前位置: 首页>>代码示例>>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;未经允许,请勿转载。