News:

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

Main Menu

Don't allow message in Personal Message email notification

Started by Square, July 08, 2012, 07:51:14 AM

Previous topic - Next topic

Square

Hi,

SMF 2.0.2

Which changes should I do to have only the link to the PM and not the message itself in the PM email notification?
I really don't like when people answer to the email instead of going to their PM box!



The email is now like this:

You have just been sent a personal message by [member name] on [forum name].

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

The message they sent you was:

[message]

Reply to this Personal Message here: http://www.yourwebsite.com/forum/index.php?action=pm;sa=send;f=inbox;pmsg=38;quote;u=25




and I would like to have it like this:

You have just been sent a personal message by [member name] on [forum name].

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

Read this Personal Message here: http://www.yourwebsite.com/forum/index.php?action=pm#msg40

Reply to this Personal Message here: http://www.yourwebsite.com/forum/index.php?action=pm;sa=send;f=inbox;pmsg=38;quote;u=25




Thanks in advance for your help.  :)

Branko.

Themes\default\languages PersonalMessage.english.php
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Square

Quote from: Branko. on July 08, 2012, 08:28:12 AM
Themes\default\languages PersonalMessage.english.php

Thanks but it doesn't tell me what to change.
I really can't find it by myself.

Square

What do I have to change in Sources\Subs-Post.php and Themes\default\languages\PersonalMessage.english.php so that it does what I need (see my first post)?

CapadY

Send me a emailaddress by PM and I will send you a MOD that will give you a setting in Admin panel to hide the message in a PM.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

Square

Quote from: CapadY on July 10, 2012, 04:18:16 AM
Send me a emailaddress by PM and I will send you a MOD that will give you a setting in Admin panel to hide the message in a PM.

Thank you but if you read my first post you'll see that your MOD doesn't do exactly what I need.
Your MOD doesn't add the message in the email and keep the link to answering to the PM.
That's ok but what I need is that the message is replaced by a link to read the PM, not answering to it, like this:
Read this Personal Message here: http://www.yourwebsite.com/forum/index.php?action=pm#msg40
Maybe you can work on it? ;)

CapadY

When you just have a problem about the content of the email, use the next MOD after installing the first one:

http://custom.simplemachines.org/mods/index.php?mod=2926

The only problem is, in your example you are pointing to two different messages in one email and I think that wouldn't be possible without recoding.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

Square

Quote from: CapadY on July 11, 2012, 02:29:48 AM
The only problem is, in your example you are pointing to two different messages in one email and I think that wouldn't be possible without recoding.

Of course I want to link to the same message.
Let's make it more simple; I would like the PM notification email like this:

You have just been sent a personal message by [member name] on [forum name].
IMPORTANT: Remember, this is just a notification. Please do not reply to this email.
Read this Personal Message here: http://www.yourwebsite.com/forum/index.php?action=pm#msgXX


I know what to do to remove the message itself from the email.
I know how to edit Themes\default\languages\PersonalMessage.english.php to change
Reply to this Personal Message here:
into
Read this Personal Message here:

What I do not know is what to do to have a link to the PM and not to a quote of the PM.



emanuele

In Subs-Post.php:
Code (find) Select
$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm;sa=send;f=inbox;pmsg=' . $id_pm . ';quote;u=' . $from['id'];
Code (replace with) Select
$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm;pmsg=' . $id_pm;
should work.
Not sure how the f=inbox part is important, sorry.

ETA: answering myself, if the PM has been moved to another label and the inbox one has been removed then the PM is not shown unless there is also the reference to the label in the URL.
So, with a certain combination of rules and settings the URL will not work.
Funnily enough the quote works in that case too...since this option will be in 2.1 I'm tempted to consider this a bug... ::)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Square

Thank you. I think I got it. Maybe not the best way but it does what I need. This is what I did:

- Themes\default\languages\PersonalMessage.english.php
Code (find) Select
$txt['pm_email'] = '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';
Code (replace with) Select
$txt['pm_email'] = '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.';
Code (find) Select
$txt['instant_reply'] = 'Reply to this Personal Message here:';
Code (replace with) Select
$txt['instant_reply'] = 'Read this Personal Message here:';

- Sources\Subs-post.php
Code (find) Select
$mailmessage = str_replace(array('SUBJECT', 'MESSAGE', 'SENDER'), array($subject, $message, un_htmlspecialchars($from['name'])), $txt['pm_email']);
$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm;sa=send;f=inbox;pmsg=' . $id_pm . ';quote;u=' . $from['id'];

Code (replace with) Select
$mailmessage = str_replace(array('SUBJECT', 'SENDER'), array($subject, un_htmlspecialchars($from['name'])), $txt['pm_email']);
$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm#msg' . $id_pm ;


Now the PM notification email is like this:
You have just been sent a personal message by [member name] on [forum name].
IMPORTANT: Remember, this is just a notification. Please do not reply to this email.
Read this Personal Message here: http://www.yourwebsite.com/forum/index.php?action=pm#msg15
(which is exactly the same link than when you read a PM directly from the forum).

@CapadY:
Of course I don't have the possibility to enable/disable this function, like in your MOD.
Maybe you can make a new version of your MOD?

@SMF:
Maybe you can include "Don't allow PM text in notifications" in a next version? I think that many people are looking for such thing.


I'll do some more test and then will check this topic as solved. Thanks again for your help. :)



emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

CapadY

Once again,

My MOD is doing nearly exactly what you want.

The link is also shown in the email.
The only difference is a very slightly different text in the email.

Because the problems en time needed to get a MOD published in the MOD-list I've decided no longer to bring in MODs there.
And no, I'm not gonna change the text in the mail for just one person.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

emanuele

If you don't want to publish mods on the mod site you can post them somewhere as attachments.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Square

Quote from: CapadY on July 14, 2012, 05:05:35 PM
My MOD is doing nearly exactly what you want.

The link is also shown in the email.
The only difference is a very slightly different text in the email.

No, your email notification is linking to a reply with quote, not to the PM itself.
I will not call this "nearly exactly" the same.
People always want to read their PM, not always answering to it. Some PM doesn't even require an answer.
Adapting your MOD was just a suggestion. Not for myself but for the community.
But thanks anyway.  ;)


Edit: I'll now uncheck "notify" on this topic.



badon

This has got to be one of the most frequently requested things for SMF, in every version. We definitely need a mod, or even better, an actual feature for this. I like the ideas Square had for the mod. Any chance this will be done? I could use it, and I don't like hacking the code. I might have to figure out how to make mods eventually so it's "cleaner" than just hacking the code.

Arantor

QuoteThis has got to be one of the most frequently requested things for SMF, in every version

Actually, it really isn't. There are many things that come up so much more than this.

QuoteI might have to figure out how to make mods eventually so it's "cleaner" than just hacking the code.

The mod would almost entirely be a duplicate of what's posted above anyway - pretty much every mod is a series of find/replace operations.

badon

Quote from: Square on July 14, 2012, 01:17:33 PM
Thank you. I think I got it. Maybe not the best way but it does what I need. This is what I did:

- Themes\default\languages\PersonalMessage.english.php
Code (find) Select
$txt['pm_email'] = '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';
Code (replace with) Select
$txt['pm_email'] = '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.';
Code (find) Select
$txt['instant_reply'] = 'Reply to this Personal Message here:';
Code (replace with) Select
$txt['instant_reply'] = 'Read this Personal Message here:';

- Sources\Subs-post.php
Code (find) Select
$mailmessage = str_replace(array('SUBJECT', 'MESSAGE', 'SENDER'), array($subject, $message, un_htmlspecialchars($from['name'])), $txt['pm_email']);
$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm;sa=send;f=inbox;pmsg=' . $id_pm . ';quote;u=' . $from['id'];

Code (replace with) Select
$mailmessage = str_replace(array('SUBJECT', 'SENDER'), array($subject, un_htmlspecialchars($from['name'])), $txt['pm_email']);
$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm#msg' . $id_pm ;


Now the PM notification email is like this:
You have just been sent a personal message by [member name] on [forum name].
IMPORTANT: Remember, this is just a notification. Please do not reply to this email.
Read this Personal Message here: http://www.yourwebsite.com/forum/index.php?action=pm#msg15
(which is exactly the same link than when you read a PM directly from the forum).

@CapadY:
Of course I don't have the possibility to enable/disable this function, like in your MOD.
Maybe you can make a new version of your MOD?

@SMF:
Maybe you can include "Don't allow PM text in notifications" in a next version? I think that many people are looking for such thing.


I'll do some more test and then will check this topic as solved. Thanks again for your help. :)

I did these edits, but I still get PM notifications that say this:

Quote
The message they sent you was:

MESSAGE

Any ideas?

Illori

put everything back as it was.
Quote from: Square on July 14, 2012, 01:17:33 PM
- Themes\default\languages\PersonalMessage.english.php
Code (find) Select
$txt['pm_email'] = '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';
Code (replace with) Select
$txt['pm_email'] = '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.';
Code (find) Select
$txt['instant_reply'] = 'Reply to this Personal Message here:';
Code (replace with) Select
$txt['instant_reply'] = 'Read this Personal Message here:';


this should be the only edit you need to do. nothing else is required. also next time please start your own topic rather then bumping an old topic.

badon

Undoing the other edits made it not work in SMF 2.0.11

Advertisement: