show_post_notification_fields( $campaign_data );
}
}
/**
* Show post notification related fields
*
* Post categories etc.
*
* @since 5.1.0
*
* @param array $campaign_data
*/
public function show_post_notification_fields( $campaign_data ) {
// We are storing both post categories and CPTs in one column 'categories'.
$categories = isset( $campaign_data['categories'] ) ? $campaign_data['categories'] : '';
$campaign_id = ! empty( $campaign_data['id'] ) ? $campaign_data['id'] : 0;
$selected_post_types = array();
$using_new_category_format = ES_Campaign_Controller::is_using_new_category_format( $campaign_id );
if ( $using_new_category_format ) {
$cat_cpts = array();
$categories_str = trim( trim( $categories ), '##' );
$categories_array = explode( '##', $categories_str );
if ( ! empty( $categories_array ) ) {
foreach ( $categories_array as $category ) {
$cpt_categories = explode( '|', $category );
foreach ( $cpt_categories as $cpt_category ) {
if ( false !== strpos( $cpt_category, ':' ) ) {
list( $post_type, $post_type_categories ) = explode( ':', $cpt_category );
if ( 'post' === $post_type ) {
$cat_cpts = explode( ',', $post_type_categories );
}
$selected_post_types[] = $post_type;
}
}
}
}
} else {
$cat_cpts = ES_Common::convert_categories_string_to_array( $categories, true );
}
$allowedtags = ig_es_allowed_html_tags_in_esc();
$campaign_type = ! empty( $campaign_data['type'] ) ? $campaign_data['type'] : '';
$editor_type = ! empty( $campaign_data['meta']['editor_type'] ) ? $campaign_data['meta']['editor_type'] : IG_ES_DRAG_AND_DROP_EDITOR;
?>
labels->singular_name;
?>
class="es_custom_post_type form-checkbox"
>
get_dnd_editor_default_content();
$classic_editor_content = wpautop( $this->get_classic_editor_default_content() );
$content_data = array(
IG_ES_CLASSIC_EDITOR => $classic_editor_content,
IG_ES_DRAG_AND_DROP_EDITOR => $dnd_editor_content
);
}
return $content_data;
}
public function get_classic_editor_default_content() {
$default_content = __( "Hello {{subscriber.name | fallback='there'}},", 'email-subscribers' ) . "\r\n\r\n";
$default_content .= __( 'We have published a new blog article on our website.', 'email-subscribers' ) . "\r\n";
$default_content .= "{{campaign.posts}}\r\n{{post.title}}\r\n {{post.image}}\r\n\r\n";
$default_content .= "{{post.link}}\r\n{{/campaign.posts}}\r\n\r\n";
$default_content .= __( 'Thanks & Regards', 'email-subscribers' ) . ",\r\n";
$default_content .= __( 'Admin', 'email-subscribers' ) . "\r\n\r\n";
$default_content .= __( 'You received this email because in the past you have provided us your email address : {{subscriber.email}} to receive notifications when new updates are posted.', 'email-subscribers' );
return $default_content;
}
public function get_dnd_editor_default_content() {
$default_content = '' . __( "Hello {{subscriber.name | fallback='there'}},", 'email-subscribers' ) . '' . __( 'We have published a new post on our site.', 'email-subscribers' ) . '
{{campaign.posts}}
{{post.title}}
{{post.excerpt}}
Read More
{{/campaign.posts}}
@2022,' . __( 'Your Brand Name', 'email-subscribers' ) . '.' . __( 'You received this email because in the past you have provided us your email address : {{subscriber.email}} to receive notifications when new updates are posted.', 'email-subscribers' ) . __( 'If you wish to unsubscribe from our newsletter, click', 'email-subscribers' ) . ' ' . __( 'here', 'email-subscribers' ) . ' ';
return $default_content;
}
}
ES_Post_Notifications_Table::get_instance();