• Resolved trevorNanders

    (@trevornanders)


    Hi
    Great Forum. really enjoy using it.

    I want to remove the ‘Andwer’ element from the email notifications, so that the notification contains just a link to the forum thead.

    I have tried tweaking the forum-notifications.php file but to no avail.

    Is there a function I can add to my functions file to do this for me please?

    thanks
    R

    https://wordpress.org/plugins/asgaros-forum/

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

    (@asgaros)

    Hello trevorNanders,

    to remove this, please replace this code in the forum-notifications.php file:

    $notification_message = sprintf(__("Hello,\r\n\r\nyou got this mail because there is a new answer in a forum-topic you have subscribed to:\r\n%s\r\n\r\nAnswer:\r\n%s\r\n\r\nLink to the new answer:\r\n%s\r\n\r\nYou 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'), $thread_name, $answer_text, $answer_link);

    with:

    $notification_message = sprintf(__("Hello,\r\n\r\nyou got this mail because there is a new answer in a forum-topic you have subscribed to:\r\n%s\r\n\r\nLink to the new answer:\r\n%s\r\n\r\nYou 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'), $thread_name, $answer_link);

    Thread Starter trevorNanders

    (@trevornanders)

    Brilliant. Thanks sir for the reply.
    The only problem with this tweak is that it will be overwritten on update. Is it possible to do this change using a function I can stick in functions.php?

    Not a major problem but I’d like to keep tweaks to functions so I can leave the core plugins and to update without modifications being lost.

    thanks again 🙂

    Plugin Author Asgaros

    (@asgaros)

    Hey again!

    Sure, I added some filters for this to the dev-version:
    https://github.com/Asgaros/asgaros-forum/commit/e3e7bbbe6736f67898e4e7a42c34ad9ba3ff0bdd

    If you want to test it you can download the latest dev-version here:
    https://github.com/Asgaros/asgaros-forum/archive/master.zip

    The changes will be also included in the upcoming v1.1.6 release.

    To change the text via filters, you have to add this code to your themes functions.php file:

    function custom_notify_topic_subscribers_message($string, $thread_name, $answer_text, $answer_link) {
        $string = sprintf(__("Hello,\r\n\r\nyou got this mail because there is a new answer in a forum-topic you have subscribed to:\r\n%s\r\n\r\nLink to the new answer:\r\n%s\r\n\r\nYou 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'), $thread_name, $answer_link);
        return $string;
    }
    add_filter('asgarosforum_filter_notify_topic_subscribers_message', 'custom_notify_topic_subscribers_message', 10, 4);
    Thread Starter trevorNanders

    (@trevornanders)

    Fantastastic, Many, many thanks for this.
    Keep the great work going with this and I think it will become the go-to forum option for WordPress – over bbpress IMO.

    Plugin Author Asgaros

    (@asgaros)

    Some small changes because mails will be send as HTML-mails now, see this commit:
    https://github.com/Asgaros/asgaros-forum/commit/b80f633588f6194b79ce98774d0921755c7d7705

    So you have to change your code to this:

    function custom_notify_topic_subscribers_message($string, $thread_name, $answer_text, $answer_link) {
        $string = sprintf(__('Hello,<br /><br />you got this mail because there is a new answer in a forum-topic you have subscribed to:<br />%s<br /><br />Link to the new answer:<br />%s<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'), $thread_name, $answer_link);
        return $string;
    }
    add_filter('asgarosforum_filter_notify_topic_subscribers_message', 'custom_notify_topic_subscribers_message', 10, 4);
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Email text tweak’ is closed to new replies.