Receive notification for all new post
Quote from elementsindustriels on January 9, 2018, 2:36 pmHi,
My boss (who is also admin of the site) want receive à mail notification for all answer in every post.
The same mail notification which the “new topic” mail.It is possible? I don’t know how to use hook, and i think it’s the solution…
Can you give directly the code to put in my function.php ?Thank you very much !
Hi,
My boss (who is also admin of the site) want receive à mail notification for all answer in every post.
The same mail notification which the “new topic” mail.
It is possible? I don’t know how to use hook, and i think it’s the solution…
Can you give directly the code to put in my function.php ?
Thank you very much !
Quote from Asgaros on January 9, 2018, 4:56 pmHello,
you can try to add the following code to your themes functions.php file:
function custom_mails($mails) { $mails[] = 'mymail@example.com'; return $mails; } add_filter('asgarosforum_subscriber_mails_new_post', 'custom_mails');
Hello,
you can try to add the following code to your themes functions.php file:
function custom_mails($mails) { $mails[] = 'mymail@example.com'; return $mails; } add_filter('asgarosforum_subscriber_mails_new_post', 'custom_mails');
Quote from elementsindustriels on January 9, 2018, 5:14 pmHi!
Thanks for the answer.
This function doen’t work, i have White Screen when i added it to theme’s functions.php :/
Hi!
Thanks for the answer.
This function doen’t work, i have White Screen when i added it to theme’s functions.php :/
Quote from Asgaros on January 9, 2018, 7:18 pmPlease try it again. There was a missing semicolon.
Please try it again. There was a missing semicolon.
Quote from elementsindustriels on January 10, 2018, 12:47 pmHi !
This code works! Thank you! It’s possible to add a mail? with $additional_headers = ?
Also, i want to activate the autosubscribe too. But the code here (https://asgaros.com/support/?view=thread&id=337) doesn’t work :/
Hi !
This code works! Thank you! It’s possible to add a mail? with $additional_headers = ?
Also, i want to activate the autosubscribe too. But the code here (https://asgaros.com/support/?view=thread&id=337) doesn’t work :/
Quote from Asgaros on January 10, 2018, 4:47 pmCan you check the code again? It automatically subscribes you but without checking the checkbox in the editor. But you will see that you have a subscription after creating the topic.
You can add more mails when you repeat that line of code:
$mails[] = 'mymail1@example.com'; $mails[] = 'mymail2@example.com'; $mails[] = 'mymail3@example.com';
Can you check the code again? It automatically subscribes you but without checking the checkbox in the editor. But you will see that you have a subscription after creating the topic.
You can add more mails when you repeat that line of code:
$mails[] = 'mymail1@example.com'; $mails[] = 'mymail2@example.com'; $mails[] = 'mymail3@example.com';
Quote from elementsindustriels on January 10, 2018, 5:43 pmYeah, its okay for the multiple mail.
For the auto subscribe, i confirm:
USER1 create a post(mail to admin for new subject only). AUTHOR1 reply (mail to admin for new subject only). No mail to User1.
The code used is: function auto_subscribe($postID, $topicID) {
AsgarosForumNotifications::subscribeTopic();
}
add_action(‘asgarosforum_after_add_thread_submit’, ‘auto_subscribe’, 10, 2);thanks!
Yeah, its okay for the multiple mail.
For the auto subscribe, i confirm:
USER1 create a post(mail to admin for new subject only). AUTHOR1 reply (mail to admin for new subject only). No mail to User1.
The code used is: function auto_subscribe($postID, $topicID) {
AsgarosForumNotifications::subscribeTopic();
}
add_action(‘asgarosforum_after_add_thread_submit’, ‘auto_subscribe’, 10, 2);
thanks!
Quote from Asgaros on January 10, 2018, 7:47 pmDoes USER1 creates a post or a topic? Because this code is only working for topics which are created by USER1 and not for posts he is adding to an already existing topic. Please also keep in mind that a user does not get mails for his own answers/topics.
Does USER1 creates a post or a topic? Because this code is only working for topics which are created by USER1 and not for posts he is adding to an already existing topic. Please also keep in mind that a user does not get mails for his own answers/topics.
Quote from elementsindustriels on January 11, 2018, 10:02 amHi!
Yes, USER1 created the topic.Author1 reply to this topic.
User1 receive nothing.
For receive, he have to suscribe…
Hi!
Yes, USER1 created the topic.
Author1 reply to this topic.
User1 receive nothing.
For receive, he have to suscribe…
Quote from Asgaros on January 11, 2018, 2:09 pmPlease try it again with the following code:
function auto_subscribe($postID, $topicID) { global $asgarosforum; $asgarosforum->notifications->subscribe_topic(); } add_action('asgarosforum_after_add_topic_submit', 'auto_subscribe', 10, 2);
Please try it again with the following code:
function auto_subscribe($postID, $topicID) { global $asgarosforum; $asgarosforum->notifications->subscribe_topic(); } add_action('asgarosforum_after_add_topic_submit', 'auto_subscribe', 10, 2);