Laravel: Send notification to 1000+ users [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have a Social Network type Laravel application where users can comment and follow each other, and subscribe a page/user to get notification whenever a new blog/post has been published by the page.
Suppose, 1000+ users has subscribed to get notification for a page. Now, whenever the page publishes a post, I should send notification to all users who has subscribed.
I have a table for notifications like:-
user_id - the user who has subscribed
page_id - the page who published the blog/post
notification - the notification text (same for all users)
Basically, I want to send the notification to all users who has subscribed to the page. In laravel, I can use loop or chunk for all users to add rows to the database. But I want to know what will be the most robust way to send notification to users in laravel. Thanks.

Definitely consider looking into Laravel's Queue for this. It will give a fine tuned control over how many get sent at once, when they get sent and how to handle the case of failure. I use the Queue + Redis for a lot of very similar functionality. https://laravel.com/docs/5.4/queues

Related

Send push notifications from website to pwa [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
We have an app that has separate pwa and standard web site made in CodeIgniter(PHP framework).
Is there a way to send push notifications from a web site version of the app, to the pwa users that never visited the website?
For example when somebody post a comment on a user picture using the web site, is there a way to notify the pwa user?
From the research I've done, its possible to send the notifications from website if user accepts them, but if used that method, user would first have to visit the website on their cell phone and accept the push notifications. That is not very user friendly.
Ideally, the user would just use the pwa, accept the notifications there, and actions on the website would trigger notifications to the pwa-s user cellphone.
No.
Browser based notifications are designed to be opt-in. That policy is enforced by the browser.
Without that our phones would be buzzing 24 hours a day.
You could build a native app that does notifications.

How to get a chat id by phone number in Telegram? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I created a Telegram Bot using BotFather. My point is to notify users about sale events in the system. I can notify them when I know exactly their chat_id directly to private messages. How should I get their chat_id using their mobile number? I have an idea of getting chat_id when they subscribe into my group, but I don't know whether if it's correct way or not.
I edited my question. I'll be really appreciate if my question has got more correct.
If you use Telegram bot API to notify your users (I see you mentioned telegram-bot in tags), the documentation page says:
Bots can't initiate conversations with users. A user must either add them to a group or send them a message first.
So in order to communicate with particular user bot must receive a message from him first and then you can get chat_id from received Message object.

Web notifications subscribers data - endpoint - send notifications [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm trying to understand how web notification(HTML5) is works.
I found some solutions for call user for permissions:notify.js,
currently I am looking for any way to send notifications for subscribed users. I planing to create a backend script in PHP. What kind of data, should I save when user allows notifications receiving, for easy sending notifications?
There are two kinds of web notifications:
on-site push notifications: you can send them only when a user has a page of your website open. You can use the Web Notification API (or notify.js) to display the notification. You also need to fetch the notification from a server: you can use AJAX, long polling, websockets, etc.
off-site push notifications: you can reach a user even when he is not on your website. You need to use the Web Notification API together with the W3C Push API and service workers. In this case you need to collect an endpoint that represents the user device (browser), then store it on a server and then send notifications to it (for example using this PHP library). Otherwise you can use a service like Pushpad (I am the founder) which offers a PHP library.

MYSQL sending notifications to multiple users [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want each time a new lesson is added to the lessons table, a notification send to all students in that grade. Let's say I have 10,000 students in the fifth grade, that means a 10,000 insert operations will be made in the notifications table which is a huge load.
Is there a better idea on how to send notifications to users, knowing that a user can see the notification only ONCE.
It seems that the notification process can be made asynchronously.
I suggest to develop a separate message queue architecture for this scenario. A program will loads newly added data and put them in a queue, then another process can read the queue and (for example send emails to users). You can add more queue consumer to manage more huge data.
Of course you will need a MQ Server.
To get a filling of asynchronous development see http://www.rabbitmq.com/getstarted.html which have good examples of Rabbit MQ ( Rabbit MQ is a opensource java base messaging service).

When a notification email should be sent? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have a number of action a user can preform in a social network website, like adding friends following people and such.
Now these actions are done by Ajax, and the user could easily undo them(when say following someone, the follow link is turned into unfollow and clicking it again -of course- results in unfollowing the user, and it -the link- turning back into follow).
When these actions occur, the user (being followed) is notified by via email. and the code that sends the email is run in the same ajax call.
That results in two problems, one is that the email is sent even if the user decides to unfollow the other person at once. And two, multiple emails are sent if the user hits the follow/unfollow link multiple times.
I thought of using a session variable to store users'actions and then at "some point" check on that variable and preform accordingly. My struggle is in finding that "some point", thought of when the user logs out, but I can't guarantee that the user will actually log out.
any suggestions?
The easiest way I can see to do this is:
Push notifications in a DB table. Also, for users, have last activity column. Check often for any rows in notifications that occured before (user.last_activity + TIME_CONSTANT), pop them from the table, group them, and send off to users.
"often" can be a cron task, or even each request (since the query would be quite simple and quick).

Categories