Set up a bulk Email from Search Results

QuestionsSet up a bulk Email from Search Results
Ross Sabes asked 4 years ago

Hi,

I am a PHP programmer but have limited experience with PHP Grid. I have a client whose database is build around PHP grid (FREE version). They would like to be able to send a bulk Email to clients based on the results of a filter in the grid. I am fairly adept at javascript and PHP. I know you can export the grid results. I also am reading the documentation on grid events. Is there some way via grid events or other API to work with the results in the grid? Can I get a more comprehensive example of how this might be achieved? I can manage the bulk Email part. I just want to understand how it may be possible to programmatically access the results of a search in the grid.

Thanks for looking.

5 Answers
Abu Ghufran Staff answered 4 years ago

A simple solution would be to follow ’email selected’ case of this demo:

https://www.phpgrid.org/demo/demos/editing/bulk-edit.php
Code: https://www.phpgrid.org/demo/demos/editing/bulk-edit.phps

Set event handler: line 132-133,
Email php code: 153-160
Create toolbar button: 218-227

This feature is supported in full version so i think your client need full version library. The free version is just for non-commercial / evaluation purpose.

 

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Ross answered 4 years ago

Thank you for the information. This example should be close to what I am looking to achive. I have one followup questions if you could answer: Can I access (and send an email) to all of the results at once instead of the paginated/selected set? I want the user to be able to send an email an every row returned regardless if it on the current page in view. Thanks

Abu Ghufran Staff answered 4 years ago

Yes, Refer line 230 and 161.

This demo updated all records with a value taken from JS prompt().
You can change it accordingly.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Ross answered 4 years ago

Hi, I am working on completing this project. In your last answer the demo is updating all of the records in the table without any select query. I don’t want to update all of the records in the table, I want to update all of the records in the current queried set regardless of pagination or a select box. For example, the user types something into the search field. 150 rows are returned from the filtered query. I need to be able to work with those 150 rows returned from the query.

Thanks

 

Ross answered 4 years ago

I think I have figured something out that will work for me. I am use the \\\”on_export\\\” event to intercept an export and get the sql from the data parameter.

Your Answer

7 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?