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.

Remove Message Body From Notification

Some of my users are confused when a personal message is sent since the Body of a message is included in the notification email and they are replying to the email instead of using the message system. I want to remove the message and force them to click on link, go to website to see what message was sent (similar to how replies to discussions works).

How do I go about this?


  • Options

    I found where the code is I think (/applications/conversations/settings/structure.php), but not sure how to modify this to remove the message so its not visible in the notification and make it upgrade friendly.

    // X sent you a message if ($SQL->GetWhere('ActivityType', array('Name' => 'ConversationMessage'))->NumRows() == 0) $SQL->Insert('ActivityType', array('AllowComments' => '0', 'Name' => 'ConversationMessage', 'FullHeadline' => '%1$s sent you a %8$s.', 'ProfileHeadline' => '%1$s sent you a %8$s.', 'RouteCode' => 'message', 'Notify' => '1', 'Public' => '0'));

  • Options
    peregrineperegrine MVP
    edited August 2015

    you would need to experiment. this is just some ideas. so I won't be able to answer follow-up questions.

    if you want to remove the story

    you might try

    $Defintion['EmailStoryNotification'] ='%1\$s\n\n%2\$s';

    but this will affect other activitiy types as well. so it may not be appropriate.

    or you could use plugin

    and trigger off of this event $this->FireEvent('BeforeSendNotification');

    check the activity type equal to conversation message and null out the story(Body) in the Email object . or replace it with a link to your site. or you could.

    or possibly if you could generalize for all emails with stories.

    change the EmailStoryNotification = "%3\$s\n\n%2\$s\n\nPlease don\'t reply to the message via e-mail."

    but you (capital YOU) need to spend the effort to test under all situations, and pursue, since we all would need to do the same thing to see what would be the appropriate way to do things.

    unless of course - someone knows off the top of their head.

    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
    edited August 2015

    That helped! And, in combination with this post, I figured out I needed to add this:

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

    To locale.php.

    Thanks so much!

Sign In or Register to comment.