News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How to remove Message text in Email notifications for Private Messages?

Started by RGMears, May 16, 2019, 06:44:30 AM

Previous topic - Next topic

Arantor

That also depends which view you're in - if you're not in 'all at once', you have limited chance of seeing the right message.

RGMears

Sir Osis's posted code change works:
    All at once > list displays on top message follows
    One at a time > message appears on top list follows
    As a conversation > list displays on top message follows

Arantor

Only if the message is from the most recent conversation, or the most recent message.

RGMears

The message link in the email is specific:
   ...forum/index.php?action=pm#msg44
Where else could someone be sent?

Arantor

That takes them to the front page of action=pm, which in one-at-a-time is the most recent message. In conversation mode, the most recent conversation.

The #msg is almost incidental at that point since it doesn't get sent to the server to tell it anything and is only usable in the browser to scroll down the page.

If you have two emails because you get two PMs, the link in the first email is probably wrong unless all your users only ever use all-at-once, because both emails would only show the most recent message, regardless of anything, because that's the point of conversation mode and one-at-a-time mode.

But I'm only speaking as the author of a mod specifically designed around fixing the PM mode to be sane, and making sure it was sane in 2.1 when actually on the development team, I'm probably wrong about everything in this thread, especially as Sir Osis seems to be fond of reminding me lately.

Sorry for trying to not let you believe you had a fix that you actually didn't.

Sir Osis of Liver

Quote from: Arantor on May 20, 2019, 07:02:56 PM
I'm probably wrong about everything in this thread, especially as Sir Osis seems to be fond of reminding me lately.

Getting touchy in your old age?  I don't often disagree with you, but I do entertain different points of view.  In this case, don't know why 2.0 personal messaging was designed the way it is.  Way too complicated, too many options.  At some point in development, someone should make a decision as to which of several options is best, and just do it that way.  Trying to incorporate all variations as user options just makes things complicated, and in some cases opaque, for the typical user.  Why are sent pms not saved by default?  Makes no sense.  Just because you can do something doesn't mean you should.

But yes, as for OP's request, the solution I posted is dependent on how user has ordered pms in profile, as Illori pointed out above.  Since most people don't know (or care) that they can change how pms are displayed, you can just set the option that works best for all users.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RGMears

The plot thickens, as they say.
Arantor is correct. The id "#msg45" is removed from the address bar in the browser.
    When "One at a time" is selected, only the most recent PM displays. Not necessarily the PM in the link.
    When "All at once" is selected, all messages are displayed in the order they were sent.
    When "In a conversation" is selected, only the most recent PM displays. Again not necessarily the PM in the link.
This is remarkably screwy.
I recently convinced a group I am working with to use a private forum (built with SMF, of course) instead of multiple recipients in emails and using Google Docs for working on publishable material. That Private Messaging is available helped to "sell" them on the idea.
That it works so erratically doesn't help here.


And there is another hiccup which perhaps warrants a new Topic:
If a "Visual verification image to display" is selected (other than None) then every user (except administrators) has to type the characters in the "Visual verification image" (in the box below) in order to send a Private Message. The only option regarding verification is "Require verification on registration page". Registration and Private Messaging are not connected. Once registered, users should not have to pass a security check every time they want to PM someone.

Illori

Quote from: Sir Osis of Liver on May 20, 2019, 10:41:46 PM
Why are sent pms not saved by default? 

that has been corrected in SMF 2.1, we cannot fix it in SMF 2.0 at this point. you are more then welcome to create a mod to fix it if you want.

Quote from: Sir Osis of Liver on May 20, 2019, 10:41:46 PM
Since most people don't know (or care) that they can change how pms are displayed, you can just set the option that works best for all users.

that is not an option that can be set globally via the UI.

Quote from: RGMears on May 21, 2019, 05:06:43 AM
And there is another hiccup which perhaps warrants a new Topic:
If "Require verification on registration page" is selected then every user (except administrators) has to type the characters in the "Visual verification image" (in the box below) in order to send a Private Message. These two things are not connected. Once registered, users should not have to pass a security check every time they want to PM someone.

you can disable that feature admin -> security and moderation -> anti-spam change the post count under which users must pass verification when sending personal messages to 0 to disable it.

RGMears

Thanks for the heads up on requiring verification in relation to post count on personal messages, Illori.

Sir Osis of Liver

The pm system doesn't work erratically, it just isn't designed to do what you want it to do.  Basically you're trying to email a url that will link to a specific message, don't know if there's any way to do that.  Will take a look at the code soon as I get a chance.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RGMears

Thanks Sir Osis.
A question, though. If the link in a notification for a post can take the user right there why can't the same thing happen with a PM?
And, if I copy and paste the link in the notification email in the address bar of the browser I am taken right to the message.

Sir Osis of Liver

Would have to link directly to id_pm, don't know if that can be done.  Taking a look now.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Quote from: Sir Osis of Liver on May 20, 2019, 10:41:46 PM
Getting touchy in your old age?

No, just fed up by people who spout opinions that are objectively wrong and seem intent on wasting my time.

Why does SMF 2.0 have multiple choices? Well, 1.1 only had the one choice and it wasn't super well liked, and more choices were added, but at some point in time, people complained that 'it changed' and enough people complained about new things that the developers at the time decided to make it optional so people could opt into the new choices. Removing the older choices always seems to upset people even if the new choice is in every respect objectively better, but the developers of this project historically have been shouted at for not making every damn thing optional. (I am a strong advocate of not having many options, but having the right options, but this too has historically been a controversial opinion to hold.)

Sent PMs were not saved by default originally for performance reasons; back in 2003 when this started out, space was much more scarce, so it's a deliberate design decision that discourages people clogging up the server with too many messages (since once the recipient and the sender both delete a message, the actual message text is pruned from the database to converse space). 15+ years later, server space is cheap, and the decision was made to make saving sent PMs mandatory. A little bit of context goes a long way.

Quote
But yes, as for OP's request, the solution I posted is dependent on how user has ordered pms in profile, as Illori pointed out above.  Since most people don't know (or care) that they can change how pms are displayed, you can just set the option that works best for all users.

If only admins could actually configure those values for people. Requires a mod, but I have no inclination to re-provide the mod I wrote for this purpose.

Sir Osis of Liver

   

Quote from: Arantor on May 23, 2019, 05:13:30 PM
I am a strong advocate of not having many options, but having the right options, but this too has historically been a controversial opinion to hold.

That basically was my point, so we're actually in agreement.

Quote
If only admins could actually configure those values for people. Requires a mod, but I have no inclination to re-provide the mod I wrote for this purpose.

Admins can set 'Show most recent personal messages at top' for all members in theme settings, don't know if that helps OP.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RGMears

Quote from: RGMears on May 21, 2019, 06:49:07 PM
... if I copy and paste the link in the notification email in the address bar of the browser I am taken right to the Message.
Seems to me, other discussions aside, that when clicking on the link in the email notification the user should end up on the page where the new Message is displayed, regardless of which option for how Messages are displayed.

Sir Osis of Liver

If you look at message headers in a topic, the title for each post is a link, so you can link directly to any post on the forum, like this.  The headers on pms are not links, you can only link to the top of each pm thread.  Depending on which display option is in effect, that can be the first (oldest) or last (newest) pm in the thread.  You want to link direrctly to the newest, but there's no simple way to do that if users have different display preferences.
 
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RGMears

Yet each message has an "id" tag > <a id="msg45"></a>
It is positioned inside the "poster" information group of elements.
And the link to the message, within the list of messages in either inbox or sent items, is:
    website/index.php?action=pm;pmid=45;kstart;f=inbox;start=0;sort=date;#msg45


And viewing messages seems best in "As a conversation".


I am not sure what, if anything, can be done (I am a designer not a programmer). But it seems to me that the closer this can come to emulating the way email clients work the better. The way it works now is off putting to people.

Sir Osis of Liver

Every message has an id_pm, same as topic posts have id_msg, difference is they're not included in pm template as they are for messages, so you can't link to them directly.  Probably could be custom coded, never tried it.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RGMears

You can link to each PM internally. Why can this not be case for notification links?

Sir Osis of Liver

Quote from: RGMears on May 24, 2019, 05:09:15 AM
And the link to the message, within the list of messages in either inbox or sent items, is:
    website/index.php?action=pm;pmid=45;kstart;f=inbox;start=0;sort=date;#msg45

Doesn't work on this forum.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: