Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Where to modify email content


I love this addon and it's working wonderfully for me, but I would like to tweak some of the content inside the email message itself. Specifically, I'm worried about users responding to the email rather than the actual forum post, so I want to add a line in the message telling them not to respond to the email. I've been digging around some of the files looking for the code dealing with this, but haven't had much success. Could someone direct me to the file / coding I would need to modify to make this happen? Thank you kindly.



  • Options
    peregrineperegrine MVP
    edited November 2012

    you need to change this definition in you theme, locale or add it to or create a conf/locale.php I believe.

    <?php if (!defined('APPLICATION')) exit();
        $Definition['EmailStoryNotification'] = '%1$s
        Follow the link below to check it out:
        Have a great day!';

    or maybe......

    $Definition['EmailNotification'] that needs to be changed. e.g.

    $Definition['EmailNotification'] = '%1$s
    Follow the link below to check it out:
    Have a great day!';

    I haven't tested and don't use the plugin.

    you could change "Have a Great Day" to "Please don't reply to this message via E-mail. Have a great day!"

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options


    I haven't looked at the code in a while (or any PHP code for that matter), but it's always nice to reevaluate code written by yourself ages ago.

    As far as I can see and remember, this is the code that sets the body of the email (in default.php) :

            T($Story == '' ? 'EmailNotification' : 'EmailStoryNotification'),
            Url('/discussion/'.$DiscussionID.'/'.Gdn_Format::Url($DiscussionName), TRUE),

    which sets the email body to contain the $ActivityHeadline and a link to the actual discussion as well as the entire $Story. What you actually want to do there is to modify the $Story parameter (I think??, but I don't have a Vanilla installation to test) and put something like below instead of just passing $Story as a parameter

    substr($Story,0,300) . '<a href="' . Url('/discussion/'.$DiscussionID.'/'.Gdn_Format::Url($DiscussionName), TRUE) . '">Read more</a>'

    Of course, none of this is tested and is only based on paste memories, so take it with a grain of salt. If that doesn't work, post here again and I will try to fix it in one evening.


  • Options

    Wow! Thank you so much for the quick and helpful responses. I'll will make another attempt with this new info this weekend and let you how it goes. Thanks again!


Sign In or Register to comment.