⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

select multiple to send a mail to the group selected



Ahmed Fathi
  • profile picture
  • Member

Posted 10 August 2013 - 20:46 PM

hi,

 

i need to add a multiple selection and add a button to send mail to all selected.

mean that :- i need to get all the emails from email column in my table.

                    and get all emails in an array and send it to function or action or page that will send the email to the array of selected mails

thanks :)


davidoster
  • profile picture
  • Member

Posted 11 August 2013 - 06:15 AM

Hello and welcome to the forums [member=ahmed fathi].

 

1. I would modify the list_template.php under assets/grocery_crud/themes/your_theme/views the html code for the button

2. I would make an ajax call to a controller function that would pass the selected emails and send to these only (the email message)

 

For the part of adding a way to multiple select I would use the trick of the fake column (just add on the columns function an extra field) and then I would use the callback_column to make an html checkbox to this column for every row/record of the table.

Of course along with all these you need some jQuery magic to get the checked checkboxes and pass them to the ajax call of the controller function that actually sends the email but I think this is pretty easy.


Ahmed Fathi
  • profile picture
  • Member

Posted 12 August 2013 - 11:06 AM

Hello and welcome to the forums [member=ahmed fathi].

 

1. I would modify the list_template.php under assets/grocery_crud/themes/your_theme/views the html code for the button

2. I would make an ajax call to a controller function that would pass the selected emails and send to these only (the email message)

 

For the part of adding a way to multiple select I would use the trick of the fake column (just add on the columns function an extra field) and then I would use the callback_column to make an html checkbox to this column for every row/record of the table.

Of course along with all these you need some jQuery magic to get the checked checkboxes and pass them to the ajax call of the controller function that actually sends the email but I think this is pretty easy.

i am using datatables theme can you help me in more details , please. 

i just wana to get all selected emails in an array. (need that function that can return array with emails selected)


Amit Shah
  • profile picture
  • Member

Posted 12 August 2013 - 13:38 PM

Hi Ahmed Fathi,

 

/topic/421-multiple-delete-selection/

 

This topic shows as how to have a list with select box and have a button (here its delete .. u can attach send mail) and get things in action. This you surely can use in as a reference / example. Mind it .. dont just replace the list.php .. it is built for flexigrid example if not mistakened. Just get the code out of it.. and use it as required. Should solve your requirement.

 

Happy GCing...