Notification sistem

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
fciprian
Veteran Member
Posts: 52
Joined: 2020-04-20 10:51

Notification sistem

Post by fciprian » 2020-11-23 23:29

Hello
I try to make a notification sistem.
I have made a table with Name and E_mail and a CHECKBOX:
Emil [email protected]
I have added the automatically email sending code after insert to /hooks folder to the table file and at email recipients i put $notifications
When i check the box it is 1 in the db. So i search like this :

Code: Select all

$notifications =sqlValue("SELECT E_mail FROM Notifications where CHECKBOX='1'");
When i have only one line with one email it works. When i check the box it is sending the email and when i disable the box it does not send the email.

The problem is then i have 2 or more lines with emails:
Emil [email protected]
Marius [email protected]
Ema [email protected]
So i need to request: [email protected], [email protected], [email protected]
I have tryed with :

Code: Select all

$notifications =sqlValue("SELECT E_mail,+', ' FROM Notifications where CHECKBOX='1'");
but no luck...

Can anyone help me with the corect $notifications request? i need to recive [email protected], [email protected], [email protected] from the request.

Thank you.
Last edited by a.gneady on 2020-11-28 13:14, edited 1 time in total.
Reason: Code formatting

ksabra
Posts: 8
Joined: 2020-05-26 11:58

Re: Notification sistem

Post by ksabra » 2020-11-26 15:11

Query mail inside array
After that, to send a message to everyone, use foreach and put mail in it
To prevent the mail addresses of the other recipients from appearing

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Notification sistem

Post by pbottcher » 2020-11-26 18:49

Try

Code: Select all

select group_concat(E_mail) from Notifications where CHECKBOX='1' group by CHECKBOX
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

fciprian
Veteran Member
Posts: 52
Joined: 2020-04-20 10:51

Re: Notification sistem

Post by fciprian » 2020-11-27 00:07

That was perfect!

Thank you very much! I appreciate

Post Reply