1
CoolPops
How to send notification to someone not subscribed?
  • 2005/1/18 15:35

  • CoolPops

  • Just popping in

  • Posts: 65

  • Since: 2003/4/9 1


I wrote a module that users post messages to a weblog. When a comment is left on that post, I want to send the owner a notification.

I thought of just subscribing them to posts automatically as they post them, but their Notifications list will become very large quickly, and largely unmaintainable. Therefore, I thought I would just send a notification based on a setting in the weblog setup, "Receive new comment notifications?".

I knew of the notifications handler I thought I would just trigger it with the specified user_id in the user_list array, however, when looking into it deeper it states in the dev wiki: "$user_list - if left blank, any user who subscribed to the event will receive notification. If you specify an array of users (an array of user id's), only those users will be notified (only if they are subscribed)."

So. I thought of one solution, but it's goofy and not very good programming, but on a comment post, I could subscribe them, send a notification, then unsubscribe them. This seems silly.

Is there a better way to handle this situation?

Thanks,

CoolPops

2
Mithrandir
Re: How to send notification to someone not subscribed?

Might be easier just sending a PM/Email manually to the owner, when a new comment is there, depending on his preferred notification method.

However, wouldn't it be better to make a global notification: "Receive notification when comments are added to my posts".

Then when a comment is left on the post, you trigger the global notification with the owner's userid - if he is subscribed, he will receive the notification, if not, he will not receive it. Since you are only notifying the owner, it doesn't matter about the item ID and thus you can make it a global notification.

That would also mean that you stay clear of accusations of spamming and give your users a way to enable/disable this notification.

3
CoolPops
Re: How to send notification to someone not subscribed?
  • 2005/1/18 16:22

  • CoolPops

  • Just popping in

  • Posts: 65

  • Since: 2003/4/9 1


Mithrandir,

Yes! That is a much better idea. Makes more sense and works within the design principals of the comment system.

Thanks for suggesting that to me, I will make changes to my code to bring that about.

Thanks again,

CoolPops

4
Mithrandir
Re: How to send notification to someone not subscribed?

Anytime.

Good luck with your project.

Login

Who's Online

158 user(s) are online (91 user(s) are browsing Support Forums)


Members: 0


Guests: 158


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits