• Resolved jmolenaar

    (@jmolenaar)


    Hello,

    Is it possible to set your own text in te notifications. Now i get:

    Hello,
    You received this message because there is a new forum-topic:
    …..

    I would like to change it but every time i update the plugin the text is set back to its original.

    Thank u

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello @jmolenaar,

    you can use one of the following filters to modify the text:

    – asgarosforum_filter_notify_topic_subscribers_message
    – asgarosforum_filter_notify_global_topic_subscribers_message

    Example:

    function custom_notify_topic_subscribers_message($string, $thread_name, $answer_text, $answer_link) {
        $string = "My new text.";
        return $string;
    }
    add_filter('asgarosforum_filter_notify_topic_subscribers_message', 'custom_notify_topic_subscribers_message', 10, 4);
    Thread Starter jmolenaar

    (@jmolenaar)

    Hello Asgaros,

    Thank u for the quick reply. I also want to include te link to the topic en the subject.

    Would this work?

    function custom_notify_topic_subscribers_message($string, $thread_name, $answer_text, $answer_link) {
    global $asgarosforum;
    $link = html_entity_decode($asgarosforum->get_link($asgarosforum->current_thread, $asgarosforum->url_thread).’#postid-‘.$asgarosforum->current_post);
    global $wpdb;
    $post_title = $thread_name;
    $post = $wpdb->get_row($wpdb->prepare(“SELECT text FROM wp_forum_posts WHERE id = %d;”, $post_id));
    $subject = “Nieuw topic geplaats op Flexwise Forum”;
    $string = “Er is een nieuwe topic geplaatst het forum.<br><br><b>Let op!</b> Om op een notificatie te ontvangen wanneer er een reactie is
    geplaatst op het topic dien je je aan te melden voor dit top. Dit doe je door onderaan <i><u>Abonneren op dit onderwerp.</u></i> aan te klikken.<br> <br>
    Link naar het nieuwe topic:<br />$answer_link”;
    }
    add_filter(‘asgarosforum_filter_notify_topic_subscribers_message’, ‘custom_notify_topic_subscribers_message’, 10, 4);

    Plugin Author Asgaros

    (@asgaros)

    Hello @jmolenaar

    You dont need to generate the links or subjects again. Just use the variables of the functions, they contain everything:

    – $thread_name
    – $answer_text
    – $answer_link

    Thread Starter jmolenaar

    (@jmolenaar)

    Hello Asgaros,

    Again thank u for your support. Would this be enough then?

    function custom_notify_topic_subscribers_message($string, $thread_name, $answer_text, $answer_link) {
    $subject = “Nieuw topic geplaats op Flexwise Forum”;
    $string = “Er is een nieuwe topic geplaatst het forum.<br><br><b>Let op!</b> Om op een notificatie te ontvangen wanneer er een reactie is
    geplaatst op het topic dien je je aan te melden voor dit top. Dit doe je door onderaan <i><u>Abonneren op dit onderwerp.</u></i> aan te klikken.<br> <br>
    Link naar het nieuwe topic:<br />$answer_link”;

    }
    add_filter(‘asgarosforum_filter_notify_topic_subscribers_message’, ‘custom_notify_topic_subscribers_message’, 10, 4);

    • This reply was modified 8 years ago by jmolenaar.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Text notifications’ is closed to new replies.