Replies
- kumar on February 15, 2021 at 6:11 pm in reply to: [Resolved] Can you help me with this code. #36228
Hi, Brajesh.
Thanks for replying.
But the code is not sending email to the user followers when the user publishes a post, here is a complete code.
function wpdocs_set_html_mail_content_type() { return 'text/html'; } function post_notification($post_ID) { global $wpdb ; $post = get_post($post_ID) ; add_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' ); $aUsersID = bp_get_following_ids('user_id='.bp_loggedin_user_id() ); foreach($aUsersID as $iUserID) { $user = get_userdata($iUserID) ; $to = $user->user_email ; $subject = '[' . get_bloginfo('name') . '] Nuevo post en el blog' ; $message = 'Nuevo Post: <a href="' . get_permalink($post_ID) . '">' . $post->post_title . '</a>' ; $message .= '<br/><br/>' ; $message .= nl2br($post->post_content) ; wp_mail( $to, $subject, $message ) ; } } add_action('publish_post', 'post_notification') ;
- kumar on February 13, 2021 at 9:48 am in reply to: [Resolved] Can you help me with this code. #36195
Any Idea Brajesh?
- kumar on June 8, 2020 at 6:56 pm in reply to: [Resolved] Can you help me with the small snippet #30608
Thanks Ravi , it is working fine.
- kumar on May 31, 2020 at 12:58 pm in reply to: [Resolved] Can you help me with the small snippet #30359
Any Idea ?
- kumar on May 30, 2020 at 9:37 am in reply to: [Resolved] Can you help me with the small snippet #30334
I am using buddypress legacy template.