Mingle Forum is very useful WordPress Plugin that allows you to quickly put a Forum on your WordPress site/blog.
Email notifications in Mingle Forums is one area which needs improvement. Earlier for a previous version, I had posted a hack so that every member could get email notifications for any new topic started by any user here. Since then, plugin has been updated and old hack no longer works for the Plugin ver 1.0.33.
For the current Mingle Forum Plugin ver 1.0.33, I made few changes in the wpf.php file made it to work like this:
Open wp-content/plugins/mingle-forum/wpf.php
Find:
function notify_forum_subscribers($thread_id, $subject, $content, $date, $forum_id)
{
global $user_ID;
$submitter_name = (!$user_ID)?"Guest":$this->get_userdata($user_ID, $this->options['forum_display_name']);
$submitter_email = (!$user_ID)?"guest@nosite.com":$this->get_userdata($user_ID, 'user_email');
$sender = get_bloginfo("name");
$to = get_option("mf_forum_subscribers_".$forum_id, array());
$subject = __("Forum post - ", "mingleforum").$subject;
$message = __("DETAILS:", "mingleforum")."
".
__("Name:", "mingleforum")." ".$submitter_name."
".
// __("Email:", "mingleforum")." ".$submitter_email."
".
__("Date:", "mingleforum")." ".$this->format_date($date)."
".
__("Reply Content:", "mingleforum")."
".$content."
".
__("View Post Here:", "mingleforum")." ".$this->get_threadlink($thread_id);
$headers = "MIME-Version: 1.0\r\n".
"From: ".$sender." "."<".get_bloginfo("admin_email").">\r\n".
"Content-Type: text/HTML; charset=\"".get_option('blog_charset')."\"\r\n".
"BCC: ".implode(",", $to)."\r\n";
if(!empty($to))
wp_mail("", $subject, make_clickable(convert_smilies(wpautop($this->output_filter(stripslashes($message))))), $headers);
}
Replace with following:
function notify_forum_subscribers($thread_id, $subject, $content, $date, $forum_id)
{
global $user_ID, $wpdb;
$submitter_name = (!$user_ID)?"Guest":$this->get_userdata($user_ID, $this->options['forum_display_name']);
$submitter_email = (!$user_ID)?"guest@nosite.com":$this->get_userdata($user_ID, 'user_email');
$sender = get_bloginfo("name");
$users = $wpdb->get_results("SELECT user_email FROM {$wpdb->users} ORDER BY user_login ASC");
foreach($users as $u) $to[] = $u->user_email;
$subject = __("Forum post - ", "mingleforum").$subject;
$message = __("DETAILS:", "mingleforum")."
".
__("Name:", "mingleforum")." ".$submitter_name."
".
// __("Email:", "mingleforum")." ".$submitter_email."
".
__("Date:", "mingleforum")." ".$this->format_date($date)."
".
__("Reply Content:", "mingleforum")."
".$content."
".
__("View Post Here:", "mingleforum")." ".$this->get_threadlink($thread_id);
$headers = "MIME-Version: 1.0\r\n".
"From: ".$sender." "."<".get_bloginfo("admin_email").">\r\n".
"Content-Type: text/HTML; charset=\"".get_option('blog_charset')."\"\r\n".
"BCC: ".implode(",", $to)."\r\n";
if(!empty($to))
wp_mail("", $subject, make_clickable(convert_smilies(wpautop($this->output_filter(stripslashes($message))))), $headers);
}
This change will start sending new topic email notifications to every member of your website.
Hope that helps.
Cheers!
Hi!
Seems like it won’t work for version 1.0.34, because there isn’t a wpf.php anymore. Would love to see this function work in the new version!
They keep changing the core files without adding this functionality to the Plugin by default. I will try to check the latest files and see what can be done,