News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Don't want PM text in notification email

Started by saldali, November 10, 2005, 04:06:31 AM

Previous topic - Next topic

saldali

Title says all, notification email of new PM's contains the PM text. don't want that...

how can i fix this issue??

thank you

kriskd

I'd like to second this request.  This is the big item that is preventing me from using SMF.  For the novice user the PM notifications look like standard e-mails and it is so automatic for them to reply to it.  I'd like to know if this feature might be coming or if there are perhaps more topics on this subject (link please).  :)
SMF 2.0.2

kriskd

I think I just discovered this feature in SMF 1.1 RC2, namely:

"Don't allow post text in notifications?"

If this is true, I'm a pretty happy admin!!!!
SMF 2.0.2

H

If you don't like the way e-mails are sent out you can edit the relevant language file. I believe the file might be index.english.php
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

kriskd

Okay, I was wrong in my assumption about "Don't allow post text in notifications?".  This doesn't apply to the content of PM notifications.  So, my request still stands, I really need the option to not have the PM text in an e-mail notification because they look too much like a standard e-mail.

I understand I can beef up the language that tells the person not to reply, but is there anyway now to remove this content of the PM from the e-mail notification.  If it's just a matter of removing something from index.english.php, can someone tell me what that would be?  I am using SMF 1.1 RC2.

Thanks.
SMF 2.0.2

Oldiesmann

Themes/default/languages/PersonalMessage.english.php

Find
$txt[562] = 'You have just been sent a personal message by SENDER on ' . $context['forum_name'] . '.' . "\n\n" . 'IMPORTANT: Remember, this is just a notification. Please do not reply to this email.' . "\n\n" . 'The message they sent you was:' . "\n\n" . 'MESSAGE';

Replace
$txt[562] = 'You have just been sent a personal message by SENDER on ' . $context['forum_name'] . '.' . "\n\n" . 'IMPORTANT: Remember, this is just a notification. Please do not reply to this email.';

Find
$txt['instant_reply'] = 'Reply to this Personal Message here:';

Add after that
$txt['instant_view'] = 'View this Personal Message here:';

Sources/Subs-Post.php

Find
$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm;sa=send;f=inbox;pmsg=' . $ID_PM . ';quote;u=' . $from['id'];

Replace
$mailmessage .= "\n\n" . $txt['instant_view'] . ' ' . $scripturl . '?action=pm#' . $ID_PM;

That will remove the message text from the notification emails and will also change the last line to say "You can view this Personal Message here: {url}" (with {url} being a link to the message) instead of "You can reply to this Personal Message here: {url}" (with {url} being a link to reply to the message). Makes things a bit more convenient, since users will want to view the message before replying to it.
Michael Eshom
Christian Metal Fans

kriskd

Thanks for the code suggestions!  I'll have to see if I can get that going!

Sort of a dumb question -- these changes won't affect the users ability to request/recover a new password or anything, right?  I had done a modification with a different forum package and because of that, the user couldn't request a new password.
SMF 2.0.2

sbarnes

Excellant, thank you very much, works a treat.
Just tested the requesting a new passsord thing and that works as well.

Great job

Oldiesmann

Quote from: kriskd on May 16, 2006, 01:38:17 PM
Thanks for the code suggestions!  I'll have to see if I can get that going!

Sort of a dumb question -- these changes won't affect the users ability to request/recover a new password or anything, right?  I had done a modification with a different forum package and because of that, the user couldn't request a new password.

That's a completely different email message, so no it won't. :)
Michael Eshom
Christian Metal Fans

kriskd

Thanks Oldiesmann -- that worked perfectly for me as well!

Wish me luck people, I'll be launching my SMF forum either late Thursday or on Friday.  I think I got it working the way I want to!
SMF 2.0.2

lordg

I cant find this "Sources/Subs-Post.php"

Can you help with the exact location like the previous bit i.e Themes/language/english etc. Tried the search button etc.

Thanks in advance :)

Arantor

Sources/Subs-Post.php is the exact location. It doesn't live anywhere inside the themes area.

lordg

Thanks I found it and amended it but there were two similar posts called the same as you mention above. However still the message is displayed on the email about a PM ?

Thanks

JimM

There's only one that matches exactly as Oldiesmann posted it and if you change that one it should work fine.
Jim "JimM" Moore
Former Support Specialist

lordg

Sorry me again, whats the command to find the relevant text within the text document ?? Tried looking but no luck  :-[

Thanks

Arantor

So what package are you using open and edit the document?

lordg

Hi,

1.1.11 Found the file, then right clicked on the relevant file and clicked Edit.

Now have the file text open in front of me, I think there is a command which brings up a window where I can input the text and find the relevant line but I cannot remember what the command is ?

Thanks

Wizzlefits


Arantor

So... cPanel code editor? You could try using your browser's own find function (Ctrl-F) I suppose...

lordg

Yeah sorry thats what I am using.

In fact it seems I have already replace the text with

      $mailmessage .= "\n\n" . $txt['instant_view'] . ' ' . $scripturl . '?action=pm#' . $ID_PM;

But still PM's get text included ??


Arantor

$txt[562] = 'You have just been sent a personal message by SENDER on ' . $context['forum_name'] . '.' . "\n\n" . 'IMPORTANT: Remember, this is just a notification. Please do not reply to this email.' . "\n\n" . 'The message they sent you was:' . "\n\n" . 'MESSAGE';

^^ that's the one you have to edit according to Oldiesmann's instructions; you've only edited part of it.

lordg

PM messages now look like this  :-[

You have just been sent a personal message by Gman on For Sale Forum - FREE to Join and FREE to advertise.

IMPORTANT: Remember, this is just a notification. Please do not reply to this email.

The message they sent you was:

test

http://forsaleforum.co.uk/index.php?action=pm#3162 [nofollow]

Arantor

You've modified part of it without doing the other part.

lordg

Looking at his instructions I found the first line and replaced with the line listed. Then added the extra bit, then found the next part and replace that too.

When you say I have only modified part what bit do you mean ?

Thanks

Arantor

You couldn't have made the first change because it still quoted the message....

lordg

Thats what I thought so I double checked. Code in Themes/default/languages/PersonalMessage.english.php now says.

$txt[562] = 'You have just been sent a personal message by SENDER on ' . $context['forum_name'] . '.' . "\n\n" . 'IMPORTANT: Remember, this is just a notification. Please do not reply to this email.';
$txt[748] = '(multiple recipients: \'name1, name2\')';
// Use numeric entities in the below string.
$txt['instant_reply'] = 'Reply to this Personal Message here:';
$txt['instant_view'] = 'View this Personal Message here:';

Code in Sources/Subs-Post.php now says

$mailsubject = str_replace(array('SUBJECT', 'SENDER'), array($subject, un_htmlspecialchars($from['name'])), $txt[561]);
      $mailmessage = str_replace(array('SUBJECT', 'MESSAGE', 'SENDER'), array($subject, $message, un_htmlspecialchars($from['name'])), $txt[562]);
      $mailmessage .= "\n\n" . $txt['instant_view'] . ' ' . $scripturl . '?action=pm#' . $ID_PM;

I have bolded the text for the bits I have amended and they match what has been advised but still the PM looks like the earlier message.







Wizzlefits

Pardon the stupid question.
But after making the edits, did you save the files to your server?

Arantor

Question: are you using English, English-UTF-8 or English British?

JimM

There are a total of 3 edits in 2 different files.  Did you accomplish all 3?
Jim "JimM" Moore
Former Support Specialist

lordg

Quote from: Arantor on March 13, 2010, 05:57:33 PM
Question: are you using English, English-UTF-8 or English British?

Hmmm I am not sure how would I find out ?

Quote from: JimM on March 13, 2010, 08:54:49 PM
There are a total of 3 edits in 2 different files.  Did you accomplish all 3?

I sure did, all the text in bold are the changes I made. Changed the first bit, added the second bit and then changed the last bit as per the instructions, yet still not working ?

Thanks for trying to help guys.

JimM

Quote from: lordg on March 14, 2010, 07:28:17 AM
Quote from: Arantor on March 13, 2010, 05:57:33 PM
Question: are you using English, English-UTF-8 or English British?

Hmmm I am not sure how would I find out ?

Admin > Configuration > Server Settings > Core Configuration > Default Forum Language
Jim "JimM" Moore
Former Support Specialist

lordg

#31
Ah thanks.

Forum is using English-Utf8.

Edit - You little beauty, I changed the forum language to English and it now works perfectly.

Your a star :D ;)

Comes up like this now

You have just been sent a personal message by Gman on For Sale Forum - FREE to Join and FREE to advertise.

IMPORTANT: Remember, this is just a notification. Please do not reply to this email.

View this Personal Message here: http://forsaleforum.co.uk/index.php?action=pm#3185 [nofollow]

JimM

Great.  If this is solved, please mark it solved by clicking the Mark Topic Solved link at the bottom left.
Jim "JimM" Moore
Former Support Specialist

Square

#33
SMF 1.1.16

Hi,

Thanks for the code.

I did the changes and everything is working fine except that the link in the notification email brings to the PM inbox instead of the message itself.
In other words, the 3rd line in the notification email is
View this Personal Message here: http://www.blabla.com/forum/index.php?action=pm#6412
while it should be
View this Personal Message here: http://www.blabla.com/forum/index.php?action=pm#msg6412
to go directly to the PM.

Any idea?

Thanks.  :)


Advertisement: