Adding announcement automatically

I am adding announcements from other database data by manually several times per a day. Datas are same format.
I researched MySQL table. I think oc_annoucements and oc_announcements_groups have announcements data.I intend to write tables directory by my program’s request.
Is there something wrong with this method ? Another requests or method I have to ?

I already arranged and deployed in my server. Added records to target table correctly. Able to see the announcement. But the announcement is not popupped on announcement icon. Is such as this function prohibited or not recommended ? Or I need to add another procedure ?


Do you mean, that there is no notification for that announcement via the little icon (the bell) in the upper right corner (next to profile picture)? Or do you mean that the announcements are not visible when you open the announcement app?

If you are only missing the notification for the users, you might want to take a look at the “Notification” app. It allows you to generate notifications via command line:
sudo -u http php /var/www/nextcloud/occ notification:generate

Thank you for your reply.
Yes, Upper right corner little icon (the bell) was not changed. Announcement record correctly added.

I will try also this occ command.

when you use apache2 use www-data instead of http or whoever is the user for your webfiles :wink:

Thank you for your kindly advice.
I already solved. My web server use occ command. and write a temporally file according to requested details. the file is watched by inotify tools. inotify shell execute occ command using requested text. finally appeared notification quickly each user’s page.