当前位置: 首页>>代码示例>>PHP>>正文


PHP Actions::GetSubscribers方法代码示例

本文整理汇总了PHP中Actions::GetSubscribers方法的典型用法代码示例。如果您正苦于以下问题:PHP Actions::GetSubscribers方法的具体用法?PHP Actions::GetSubscribers怎么用?PHP Actions::GetSubscribers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Actions的用法示例。


在下文中一共展示了Actions::GetSubscribers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: send_newsletter

function send_newsletter($post_ID)
{
    $sendit = new Actions();
    $article = get_post($post_ID);
    $send_now = get_post_meta($post_ID, 'send_now', true);
    $sendit_list = get_post_meta($post_ID, 'sendit_list', true);
    $table_liste = SENDIT_LIST_TABLE;
    $list_detail = $sendit->GetListDetail($sendit_list);
    $subscribers = $sendit->GetSubscribers($sendit_list);
    //only confirmed
    /*+++++++++++++++++++ TEMPLATE EMAIL +++++++++++++++++++++++++++++++++++++++++*/
    $header = $list_detail->header;
    $footer = $list_detail->footer;
    $email_from = $list_detail->email_lista;
    /*+++++++++++++++++++ HEADERS EMAIL +++++++++++++++++++++++++++++++++++++++++*/
    $email = $email_from;
    $headers = "MIME-Version: 1.0\n" . "From: " . $email . " <" . $email . ">\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
    /*+++++++++++++++++++ CONTENT EMAIL +++++++++++++++++++++++++++++++++++++++++*/
    $title = $article->post_title;
    $content = apply_filters('the_content', $article->post_content);
    $newsletter_content = $header . $content . $footer;
    $readonline = get_permalink($post_ID);
    if ($send_now == 1) {
        foreach ($subscribers as $subscriber) {
            if (get_option('sendit_unsubscribe_link') == 'y') {
                //aggiungo messaggio con il link di cancelazione che cicla il magic_string..
                $delete_link = "\n\t\t\t\t<center>\n\t \t\t\t-------------------------------------------------------------------------------\n\t\t\t\t<p>" . __('To unsubscribe, please click on the link below', 'sendit') . "<br />\n\t\t\t\t<a href=\"" . WP_PLUGIN_URL . '/sendit/' . "delete.php?action=delete&c=" . $subscriber->magic_string . "\">" . __('Unsubscribe now', 'sendit') . "</a></p>\n\t\t\t\t</center>";
            } else {
                $delete_link = '';
            }
            //send the newsletter!
            wp_mail($subscriber->email, $title, $newsletter_content . $delete_link, $headers, $attachments);
        }
        //set to 5 status : sent with classic plugin
        update_post_meta($post_ID, 'send_now', '5');
    }
}
开发者ID:tammia,项目名称:sendit,代码行数:37,代码来源:extensions-handler.php

示例2: send_newsletter

function send_newsletter($post_ID)
{
    $sendit = new Actions();
    $article = get_post($post_ID);
    $send_now = get_post_meta($post_ID, 'send_now', true);
    $sendit_list = get_post_meta($post_ID, 'sendit_list', true);
    $table_liste = SENDIT_LIST_TABLE;
    $list_detail = $sendit->GetListDetail($sendit_list);
    $subscribers = $sendit->GetSubscribers($sendit_list);
    //only confirmed
    $css = '';
    /*+++++++++++++++++++ TEMPLATE pro EMAIL +++++++++++++++++++++++++++++++++++++++++*/
    //to do: templatizer, if exixts get the template from template_id
    $header = $list_detail->header;
    $footer = $list_detail->footer;
    $css = '';
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (is_plugin_active('sendit-pro-template-manager/sendit-pro-template-manager.php')) {
        //custom post type template
        $template_id = get_post_meta($post_ID, 'template_id', true);
        $template = get_post($template_id);
        $title = $newsletter->post_title;
        //echo 'template id '.$template_id;
        $header = get_post_meta($template_id, 'headerhtml', true);
        $header = str_replace('[style]', '<style>' . $css . '</style>', $header);
        if (has_post_thumbnail($template_id)) {
            $header_image = get_the_post_thumbnail($template_id);
        } else {
            $header_image = '<img alt="" src="http://placehold.it/300x50/" />';
        }
        $header = str_replace('[logo]', $header_image, $header);
        $header = str_replace('[homeurl]', get_bloginfo('siteurl'), $header);
        $footer = get_post_meta($template_id, 'footerhtml', true);
        $content = apply_filters('the_content', $newsletter->post_content);
    }
    $email_from = $list_detail->email_lista;
    /*+++++++++++++++++++ HEADERS EMAIL +++++++++++++++++++++++++++++++++++++++++*/
    $email = $email_from;
    $headers = "MIME-Version: 1.0\n" . "From: " . $email . " <" . $email . ">\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
    /*+++++++++++++++++++ CONTENT EMAIL +++++++++++++++++++++++++++++++++++++++++*/
    $title = $article->post_title;
    //$content = apply_filters('the_content',$article->post_content);
    $content = apply_filters('the_content', $article->post_content);
    //$newsletter_content=$header.$content.$footer;
    //new 2.1.2 content is already with footer and header
    $newsletter_content = $content;
    //CSS get template id comment tag parse and extract css.... v 2.2.2
    $get_template_id = getStylesheet($newsletter_content);
    $css_id = $get_template_id[1][0];
    $css = get_post_meta($css_id, 'newsletter_css', true);
    $readonline = get_permalink($post_ID);
    if ($send_now == 1) {
        foreach ($subscribers as $subscriber) {
            if (get_option('sendit_unsubscribe_link') == 'yes') {
                //aggiungo messaggio con il link di cancelazione che cicla il magic_string..
                $delete_link = "\n\t\t\t\t<center>\n\t \t\t\t-------------------------------------------------------------------------------\n\t\t\t\t<p>" . __('To unsubscribe, please click on the link below', 'sendit') . "<br />\n\t\t\t\t<a href=\"" . get_bloginfo('siteurl') . '/' . "?action=unsubscribe&c=" . $subscriber->magic_string . "\">" . __('Unsubscribe now', 'sendit') . "</a></p>\n\t\t\t\t</center>";
            } else {
                $delete_link = '';
            }
            //send the newsletter!
            //verify if inliner is installed
            if (is_plugin_active('sendit-css-inliner/sendit-pro-css-inliner.php')) {
                $newsletter_content = inline_newsletter($css, $newsletter_content);
                $response = preg_replace('/(&Acirc;|&nbsp;)+/i', ' ', $response);
            }
            if (is_plugin_active('sendit-pro-analytics-campaign/sendit-pro-analytics-campaign.php')) {
                $newsletter_content = AppendCampaignToString($newsletter_content);
            }
            wp_mail($subscriber->email, $title, $newsletter_content . $delete_link, $headers, $attachments);
        }
        //set to 5 status : sent with classic plugin
        update_post_meta($post_ID, 'send_now', '5');
    }
}
开发者ID:bulini,项目名称:sendit,代码行数:74,代码来源:extensions-handler.php

示例3: sendit_custom_box_3

function sendit_custom_box_3($post)
{
    $sendit = new Actions();
    global $wpdb;
    $choosed_list = get_post_meta($post->ID, 'sendit_list', TRUE);
    //echo $choosed_list;
    $table_email = SENDIT_EMAIL_TABLE;
    $table_liste = SENDIT_LIST_TABLE;
    $liste = $wpdb->get_results("SELECT id_lista, nomelista FROM {$table_liste} ");
    echo '<label for="send_now">' . __('Action', 'sendit') . ': </label>';
    if (get_post_meta($post->ID, 'send_now', TRUE) == '2') {
        echo '<div class="jobrunning senditmessage"><h5>' . __('Warning newsletter is currently running the job', 'sendit') . '</h5></div>';
    } elseif (get_post_meta($post->ID, 'send_now', TRUE) == '4') {
        echo '<div class="jobdone senditmessage"><h5>' . __('Newsletter already Sent', 'sendit') . '</h5></div>';
    } else {
    }
    echo '<select name="send_now" id="send_now">';
    if (function_exists('Sendit_tracker_installation')) {
        if (get_post_meta($post->ID, 'send_now', TRUE) == 2) {
            $selected = ' selected="selected" ';
        } else {
            $selected = '';
        }
        echo '<option value="2" ' . $selected . '>' . __('Schedule with Sendit Pro', 'sendit') . '</option>';
    }
    if (get_post_meta($post->ID, 'send_now', TRUE) == 1) {
        $selected = ' selected="selected" ';
    } else {
        $selected = '';
    }
    echo '<option value="1" ' . $selected . '>' . __('Send now', 'sendit') . '</option>';
    if (get_post_meta($post->ID, 'send_now', TRUE) == 0) {
        $selected = ' selected="selected" ';
    } else {
        $selected = '';
    }
    echo '<option value="0" ' . $selected . '>' . __('Save and send later', 'sendit') . '</option>';
    if (get_post_meta($post->ID, 'send_now', TRUE) == 4) {
        $selected = ' selected="selected" ';
    } else {
        $selected = '';
    }
    echo '<option value="4" ' . $selected . '>' . __('Sent with Sendit pro', 'sendit') . '</option>';
    if (get_post_meta($post->ID, 'send_now', TRUE) == 5) {
        $selected = ' selected="selected" ';
    } else {
        $selected = '';
    }
    echo '<option value="4" ' . $selected . '>' . __('Sent with Sendit free', 'sendit') . '</option>';
    echo '</select><br />';
    echo '<h4>' . __('Select List', 'sendit') . '</h4>';
    foreach ($liste as $lista) {
        $subscribers = count($sendit->GetSubscribers($lista->id_lista));
        ?>
    	<input type="radio" name="sendit_list" value="<?php 
        echo $lista->id_lista;
        ?>
" <?php 
        if ($choosed_list == $lista->id_lista) {
            echo "checked=1";
        }
        ?>
> <?php 
        echo $lista->nomelista;
        ?>
  subscribers: <?php 
        echo $subscribers;
        ?>
<br/>
	<?php 
    }
    ?>


	<input type="hidden" name="sendit_noncename" id="sendit_noncename" value="<?php 
    echo wp_create_nonce('sendit_noncename' . $post->ID);
    ?>
" />
	
	<?php 
}
开发者ID:bulini,项目名称:sendit,代码行数:81,代码来源:meta-boxes.php


注:本文中的Actions::GetSubscribers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。