Forum breadcrumbs - You are here:Asgaros Support ForumSupportEmail Notifications
You need to log in to create posts and topics.

Email Notifications

12

Hi,

Hope you might be able to help my client and confirm some settings / functionality for her. They use the Asgaros forum on their website and are having some issues with email notifications not always being sent out.

Please see below the email notification breakdown she has provided us:

  1. Subscribe to this forum’ function is not working for members that have already been added to a user group. They are not receiving notifications when they subscribe to this forum - they would like members who have subscribed to a forum to receive email notifications as well when a new topic, reply, etc occurs within that forum
  2. ‘Subscribe to this topic’ is working only after members go and manually subscribe to each topic.
  3. New topics posted on the forum are being emailed to members part of a user group, but only new topics. Is it possible for replies to a topic to get sent as email notifications as well?

I am sure this is just a case of not the right settings being selected but if you can provide any insight / advice for her that would be awesome.

Cheers Chris

Hello @studio313

1: Subscribing to a forum means, that an user gets notified about new topics - not posts - inside that forum.

2: Right, all subscription-functionalities are opt-in only to ensure that no unwanted mails are delivered. This behavior is necessary for countries which have strict legal-rules in regards of privacy and unwanted mails.

3: If an user wants to get notified about all new topics and posts, he has to enable the "New Topics & Posts" in the subscriptions-area.

Awesome, ta heaps for getting back to me so quickly. I will pass your replies onto her and let you know if she has any follow up questions.

Thank you once again

Chris

Hi @asgaros,

My client has come back with the following question, hoping you can advise if something already exists or if it can be developed.

Is it possible to write a code to subscribe all existing and future WordPress forum users by default to all New topics and posts so they basically receive all notifications on the forum?
Can you check how long it would take and the cost?

They understand that there is normally issues around email privacy and SPAM Act's with this kind of functionality request however they have had their lawyers look into it to make sure it is ok for them to have the forum set up this way by default.

Thank you in advance

Chris

Hello @studio313

If you want that new registered users get automatically subscribed to all new topics and posts, you have to add the following code to your themes functions.php file:

add_action('user_register', array($this, 'change_subscription_settings'), 10, 1);
public function change_subscription_settings($user_id) {
    update_user_meta($user_id, 'asgarosforum_subscription_global_posts', 1);
    delete_user_meta($user_id, 'asgarosforum_subscription_global_topics');
}

Existing users must visit the subscriptions-area in the frontend and enable the "New Topics & Posts" option there.

To change the subscription-settings for all existing users you can run the following PHP-script one time:

$users = get_users();

foreach ($users as $user) {
    update_user_meta($user->ID, 'asgarosforum_subscription_global_posts', 1);
    delete_user_meta($user->ID, 'asgarosforum_subscription_global_topics');
}

 

Awesome @asgaros, thank you so much.

One quick question if thats ok because I know our client will ask this down the track - how could this be modified to automatically subscribe users to a particular forum rather than all.

Thank you heaps in advance

Chris

Hello @studio313

For forum-subscription you have to use the following meta-data instead:

add_user_meta($user_id, 'asgarosforum_subscription_forum', $forum_id);

You can find the ID of a forum inside the structure-administration.

Brilliant, thank you @asgaros

Have a great Christmas & New Year

Hi Asgaros,

Thank you you so much for your previous support - worked a treat.

My client is using both the WPFront User Role plugin for site memberships and your Forum for their members site. There has been a number of user roles created for the site using WPFront User Role and they where wondering if it is possible to link a user role to a particular forum.

For example, all users in user role "XYZ" are automatically subscribed to the corresponding Forum"XYZ"

Thank you in advance for any help/advice you might be able to provide

Cheers

Chris

Hello @studio313

From my side I can only offering automation-hooks for Asgaros Forum usergroups which can execute certain logic when an user is added to a specific usergroup. You can find a code-example here:

https://www.asgaros.de/support/topic/change-default-subscription-settings/#postid-5054

If this should work with the WPFront User Role extension, you have to ask its developers if they provide any hooks which allows you to run certain code after an user got added to a specifc group/role.

12