Please or Register to create posts and topics.

Possible To Send Email Notification To All Members?

We want to emulate the functionality of Google Groups. The only feature I couldn’t find is that ability to send an email to ALL members of the forum when a new topic is posted. Is this possible? (without manually subscribing)

 

thank you,

chad

Hello @chad

Currently there is no option for this available because of legal reasons. In a couple of countries there are strict privacy rules which dont allow you as a site-owner to send mails to users without their agreement. If you really want to do this its on your own risk.

In this case I think the asgarosforum_subscriber_mails_new_topic filter is the way to go. With this filter you can modify the array containing the mails of users who should get notified about a new topic right before the mails are sent.

Here is an example code which you can add to your themes functions.php file:

function notify_about_new_topic_mails($mails) {
  $users = get_users();

  foreach ($users as $user) {
    if (!in_array($user->user_email, $mails)) {
            $mails[] = $user->user_email;
        }
  }
  
  return $mails;
}
add_filter('asgarosforum_subscriber_mails_new_topic', 'notify_about_new_topic_mails');
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Ok, thank you! Understood about the legal issue. We are going to be a closed, private forum. All users will give permission to be emailed in this way.

thanks