SQL Statement to Turn On Email Notification of New PM

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
User avatar
profKroy
Registered User
Posts: 185
Joined: Sun Feb 14, 2016 2:39 pm

SQL Statement to Turn On Email Notification of New PM

Post by profKroy »

Hi All,

Looking for a SQL statement that hopefully someone might have in their back pocket.

The SQL will simply turn on email notifications, to notify users when they receive a PM. This is a board for my students and I'm trying to use PMing more, but need to turn on their email notifications via the database.

Thanks for your help. Any insight appreciated.

profKRoy


notification.jpg
Are you a skilled extension developer? I need an extension developed right now. Please PM me if interested.
User avatar
Mike-on-Tour
Registered User
Posts: 183
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael
Contact:

Re: SQL Statement to Turn On Email Notification of New PM

Post by Mike-on-Tour »

This question is not as easily answered as it might look like.
The notification types and whether a special type is activated or not is stored within the phpbb_user_notifications table, but they are stored there AFTER a user ticks one of the select boxes for the first time and it remains in this table even if this select box is un-ticked sometime after the first activation (being deactivated).
Following this you first have to make certain that all of your students are already listed in this table with the accurate notification type. From this arouses another question: Are all of your board members students? Maybe not, because you have some bot members as well and the guest account (both of which you have to exclude from the query). So you first have to get the user_id's of all your students and with this array you can insert those into the a/m table who are not in it already (setting the notify flag to active at this time) and then activate all others already contained in the table with the correct notification type where it is set to '0'.
The first task would be an INSERT statement and the second one an UPDATE statement.

So you first have to think about how to get the students' user_id's.

And BTW: The column in the a/m table would be item_type and the setting you are looking for is notification.type.pm
Watz fo lunch?
If you like my extensions or my support please consider a donation: Image
User avatar
ViolaF
Registered User
Posts: 1557
Joined: Tue Aug 14, 2012 11:52 pm

Re: SQL Statement to Turn On Email Notification of New PM

Post by ViolaF »

Hallo profKroy,

Das könnte die Lösung sein:
viewtopic.php?f=456&t=2545846

Gruß...
User avatar
warmweer
Jr. Extension Validator
Posts: 6493
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: SQL Statement to Turn On Email Notification of New PM

Post by warmweer »

Apart from editing the settings for each user, the default settings would also have to be edited (new users).
The question then arises: will you allow your users to change the settings? (not everyone wants to receive extra emails)

IIRC 3Di made an extension (or at least posted something extensive about default settings and board wide notification edits.

And come to think of it, there's an extension released (or at least in development which has the features you want).

Added: ViolaF found it before I did.
IIRC I tested it a couple of months ago and it wasn't exactly error-free at the time. (extra: last commit was in August).
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.
User avatar
RMcGirr83
Former Team Member
Posts: 21905
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: SQL Statement to Turn On Email Notification of New PM

Post by RMcGirr83 »

There is also this one
viewtopic.php?f=456&t=2562006 which works without errors.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
User avatar
warmweer
Jr. Extension Validator
Posts: 6493
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: SQL Statement to Turn On Email Notification of New PM

Post by warmweer »

RMcGirr83 wrote:
Thu Oct 15, 2020 9:42 am
There is also this one
viewtopic.php?f=456&t=2562006 which works without errors.
Yeah, I thought about that one also but it's per user.

hmm, ?? OK, it's per user but it's not as though there are thousands of users whose details have to be edited.
If the number of users whose notification settings need to be edited, is limited, then it's probably the best solution up to now.

As it's not been validated, try this on a testuser first (just to make sure).
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 5250
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: SQL Statement to Turn On Email Notification of New PM

Post by HiFiKabin »

ViolaF wrote:
Thu Oct 15, 2020 9:25 am
Can I please remind you that posting on phpBB.com should be in English.

Thank you
User avatar
RMcGirr83
Former Team Member
Posts: 21905
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: SQL Statement to Turn On Email Notification of New PM

Post by RMcGirr83 »

warmweer wrote:
Thu Oct 15, 2020 9:51 am
Yeah, I thought about that one also but it's per user.
Isn't the other one too? Didn't look at the code or anything but from the pics I thought it was per user.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
User avatar
warmweer
Jr. Extension Validator
Posts: 6493
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: SQL Statement to Turn On Email Notification of New PM

Post by warmweer »

RMcGirr83 wrote:
Thu Oct 15, 2020 10:42 am
Isn't the other one too? Didn't look at the code or anything but from the pics I thought it was per user.
Looking at my notes, there's an option to enable or disable notifications (and force some settings) for all users.
Anyway, that extension isn't an option as yet. Actually reading through the Development topic I would disadvise against using it on a live board.

As far as I can see the extension ViolaF linked to should cover profKroy's needs. (however, as always, a backup of the board should be taken just in case, before trying not validated extensions).
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.
User avatar
RMcGirr83
Former Team Member
Posts: 21905
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: SQL Statement to Turn On Email Notification of New PM

Post by RMcGirr83 »

Looking at my notes, there's an option to enable or disable notifications (and force some settings) for all users.
Not sure how that would work or even be possible as moderators have more notification settings than regular users....but I digress.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
User avatar
profKroy
Registered User
Posts: 185
Joined: Sun Feb 14, 2016 2:39 pm

Re: SQL Statement to Turn On Email Notification of New PM

Post by profKroy »

Thank you everyone, so much. I now understand this is not as simple as changing a single database field. Though, since I'm working with small batches of students that are divided into groups, I think it will be very easy to implement the extensions mentioned. This is such an important functionality that should be incorporated into the core of phpBB perhaps? The only thing is, I'm running 3.2.7 at the moment. Finding the time to upgrade has been a bit challenging with back to back semesters. If there is a solution for 3.2.7 please let me know, otherwise I'll just plan on doing an upgrade when I can. I should have mentioned that before.

Thanks again everyone for your help. So appreciate this community.
Are you a skilled extension developer? I need an extension developed right now. Please PM me if interested.
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51887
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: SQL Statement to Turn On Email Notification of New PM

Post by stevemaury »

Here is the answer for an SQL statement to do the job :
https://www.phpbb.com/support/docs/en/3 ... nd-values/
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
RMcGirr83
Former Team Member
Posts: 21905
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: SQL Statement to Turn On Email Notification of New PM

Post by RMcGirr83 »

stevemaury wrote:
Thu Oct 15, 2020 7:56 pm
Here is the answer for an SQL statement to do the job :
https://www.phpbb.com/support/docs/en/3 ... nd-values/
Please correct me if wrong, but that will only change the users notify type from email to IM. It won't change if a user gets notified say of a PM notification.type.pm as that is stored in a table other than the users table (the user_notifications table).
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51887
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: SQL Statement to Turn On Email Notification of New PM

Post by stevemaury »

That article predates the Notifications "feature". It may need to be updated. I will take a look at it when I finish my beer.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
Lumpy Burgertushie
Registered User
Posts: 68553
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: SQL Statement to Turn On Email Notification of New PM

Post by Lumpy Burgertushie »

or you could tell all your students that setting thier notification the way you need them is a requirement for your course.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Post Reply

Return to “Extension Requests”