We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Removing message body from Inbox email notifications | Forum

Abbey
Abbey Aug 25 '13
Could anyone please tell me how to remove the message content from inbox message notifications so that a person must log into the site to read what message was sent to them.

I looked int the language section of the admin panel but there's nothing there.

matt
matt Sep 2 '13
+1 :) I would like to know how do disable message body too.

Dave? Any clues :)

Matt
Abbey
Abbey Sep 2 '13
Thanks for the bump
dave Leader
dave Sep 2 '13

So when a member gets an PM on the site, the notification they receive in their personal email does not tell them the contents. You just want it to say, "Site PM received, login to read" instead.

 

Do I have that right?

The Forum post is edited by dave Sep 2 '13
dave Leader
dave Sep 2 '13

i may have found where it loads the text but i have not found the text.  Also i have not tested this.  And i am  not 100% sure but it looks plausable.

 

ow_plugins/notifications/bol/service.php

 

inside of this function

 

private function sendProcess

 

 try
        {
            $mail = OW::getMailer()->createMail()
                ->addRecipientEmail($email)
                ->setTextContent($txt)
                ->setHtmlContent($html)
                ->setSubject($subject);

            OW::getMailer()->send($mail);

 

 

i guess you could do a test and say  $testtxt = "hello";  $testhtml = "hello";  and then replace the $txt and $html with the other vars an see what happens.  If  you get  hello in your notification then you know you found the right place and you can make the text what you want.

 

But as always changing the core is not recommended.  My lawyer made me say that LMAO

The Forum post is edited by dave Sep 2 '13
ross Team
ross Sep 2 '13
Topic was moved from General Questions.
Abbey
Abbey Sep 2 '13

Quote from dave

i may have found where it loads the text but i have not found the text.  Also i have not tested this.  And i am  not 100% sure but it looks plausable.

 

ow_plugins/notifications/bol/service.php

 

inside of this function

 

private function sendProcess

 

 try
        {
            $mail = OW::getMailer()->createMail()
                ->addRecipientEmail($email)
                ->setTextContent($txt)
                ->setHtmlContent($html)
                ->setSubject($subject);

            OW::getMailer()->send($mail);

 

 

i guess you could do a test and say  $testtxt = "hello";  $testhtml = "hello";  and then replace the $txt and $html with the other vars an see what happens.  If  you get  hello in your notification then you know you found the right place and you can make the text what you want.

 

But as always changing the core is not recommended.  My lawyer made me say that LMAO


lol thanks dave, I don't think message content should be shown in emails, seems a mute point to have "log in to read this message" in the same email.
dave Leader
dave Sep 2 '13
YW,  test it and let me know if i found the right place.  i still have not found the text itself, its being a booger lol..   Keep me posted ;)
Abbey
Abbey Sep 2 '13
will do..... will have a crack at it later
Marisa
Marisa Jun 5 '16
I know it's an old topic, but if anybody is still interested: no, the method above is not the way to do it.


If you want to remove the message body from email notifications, open ow_plugins/notifications/components/notification.php


Find this line:


 $data['content'] = empty($data['content']) ? '' : UTIL_String::truncate($data['content'], 140, '...');


Replace with:


 $data['content'] = null;

dave Leader
dave Jun 5 '16
Thanks Marisa for the new info, i am sure it will be helpful to others.  Wow way back then i was a Oxwall nooby, oh wait i still am  :)