本文整理汇总了PHP中Actions::GetListDetail方法的典型用法代码示例。如果您正苦于以下问题:PHP Actions::GetListDetail方法的具体用法?PHP Actions::GetListDetail怎么用?PHP Actions::GetListDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actions
的用法示例。
在下文中一共展示了Actions::GetListDetail方法的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');
}
}
示例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('/(Â| )+/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');
}
}
示例3: info
<?php
/* The Newsletter template
It will recognize automatically presence of Sendit Pro Template Manager
and switch header footer css to template post type, if not get info (header / footer / css ) from the list_details
*/
$sendit = new Actions();
if (have_posts()) {
while (have_posts()) {
the_post();
$template_id = get_post_meta($post->ID, 'template_id', TRUE);
global $post;
//default free plugin value
$sendit_list = get_post_meta($post->ID, 'sendit_list', true);
$list_detail = $sendit->GetListDetail($sendit_list);
$header = $list_detail->header;
$footer = $list_detail->footer;
$css = '';
if (function_exists('sendit_pro_template_screen')) {
$template_id = get_post_meta($post->ID, 'template_id', TRUE);
$css = get_post_meta($template_id, 'newsletter_css', TRUE);
$header = get_post_meta($template_id, 'headerhtml', TRUE);
$box_styles = '.info, .success, .warning, .error, .validation {
border: 1px solid;
margin: 10px 0px;
padding:15px 10px 15px 50px;
background-repeat: no-repeat;
background-position: 10px center;
}
.info {
color: #00529B;