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

Hello,

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.

-Daniel

Comments

  • 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
        
        %3$s
        
        ---
        Follow the link below to check it out:
        %2$s
        
        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:
    %2$s
    
    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.

  • Hi!

    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) :

    $Email->Message(
        sprintf(
            T($Story == '' ? 'EmailNotification' : 'EmailStoryNotification'),
            $ActivityHeadline,
            Url('/discussion/'.$DiscussionID.'/'.Gdn_Format::Url($DiscussionName), TRUE),
            $Story
        )
    );
    

    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.

    /cd

  • 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!

    -Daniel

Sign In or Register to comment.