Send emails based on a filtered list
Send emails based on a filtered list
patrickny
Posts: 15Questions: 7Answers: 0
I'd like to be able to send emails based on a search completed in Datatables. I use a json array and serverside processing to create the table. The table creates a filtered list (Showing 1 to 35 of 35 entries (filtered from 60 total entries)), and I'd like to be able to send an email to those 35 people. I'm very new to ajax and javascript, but have some experience in php. Is this possible?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @patrickny ,
Yep , you could create a custom button, which when pressed, uses
rows().data()
with options along the lines ofrows({search:'applied'}).data().pluck(YOUR_EMAIL_COLUMN)
, and send that back via Ajax to your PHP script to send the messages.Cheers,
Colin
Good Morning Colin, Thank you for the suggestion. As I said, I'm very new at this, but you gave me a direction to go in! Thank you for your help.
I'm having a tough time. The JS for my datatable is as follows. test.php provides a json array (?) that fills the table, and makes it sortable and searchable.
There is a custom-search feature that does work correctly:
There is also an email function, but I cant figure out how to make it work correctly::
I tried making an 'export' button that would hopefully bring me one step closer, but I couldn't figure out how to make it work:
Any help that you could provide would be increditble!