Please or Register to create posts and topics.

how to notification text are modify

here i given one example i want to add some text  and some removed so how to notification edit?

 

You received this message because there is a new answer in a forum-topic you have subscribed to:
admin get notification for each reply

Author:
Asgaros

Answer:                 for e.g. This answer text how to change

Hello @we

The only thing you need to do is to go to the subscriptions-overview and activate notifications for “New Topics & Posts”.

Hello @we

You can modify the content of the mails via the following filter which you have to add to your themes functions.php file:

function change_notification_message_topic($notification_message, $topic_name, $topic_text, $topic_link, $author_name) {
  return sprintf(__('Hello,<br /><br />You received this message because there is a new forum-topic:<br />%s<br /><br />Author:<br />%s<br /><br />Link to the new topic:<br /><a href="%s">%s</a>', 'asgaros-forum'), esc_html(stripslashes($topic_name)), $author_name, $topic_link, $topic_link);
}
add_filter('asgarosforum_filter_notify_global_topic_subscribers_message', 'change_notification_message_topic', 10, 5);
function change_notification_message_post($notification_message, $topic_name, $answer_text, $answer_link, $author_name) {
  return sprintf(__('Hello,<br /><br />You received this message because there is a new answer in a forum-topic you have subscribed to:<br />%s<br /><br />Author:<br />%s<br /><br />Link to the new answer:<br /><a href="%s">%s</a><br /><br />You can unsubscribe from this topic using the unsubscribe-link at the end of the topic as a logged-in user. Please dont answer to this mail!', 'asgaros-forum'), esc_html(stripslashes($topic_name)), $author_name, $answer_link, $answer_link);
}
add_filter('asgarosforum_filter_notify_topic_subscribers_message', 'change_notification_message_post', 10, 5);

 

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hi,

Trying out this code but it gives me an error message, and does not send out the email.

( ! ) Fatal error: Uncaught ArgumentCountError: Too few arguments to function change_notification_message_topic(), 2 passed in /srv/www/nigeria-norway.org.ng/current/web/wp/wp-includes/class-wp-hook.php on line 286 and exactly 5 expected in /srv/www/nigeria-norway.org.ng/current/web/app/themes/generatepress_child/functions.php on line 341
( ! ) ArgumentCountError: Too few arguments to function change_notification_message_topic(), 2 passed in /srv/www/nigeria-norway.org.ng/current/web/wp/wp-includes/class-wp-hook.php on line 286 and exactly 5 expected in /srv/www/nigeria-norway.org.ng/current/web/app/themes/generatepress_child/functions.php on line 341

Any ideas?

Hello @notechup

Please have a look into the general Asgaros Forum settings. You can now change the content of those mails directly there (scroll down a bit to the notifications-area). This code is not necessary anymore. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Ah, hahaha man I actually saw that in the passing some time ago, but completely forgot and still thought I had to fix it with the function 🙂

Thanks again 🙂