Hi Abu and community.
Is there a chance to send email to selected recipients ?
I have a grid with data like name, adress, email,…
What I like to do is to select some rows, and with additional button (like in the bulk demo bulk-edit.php) open my standard mail program and automaticly filled the recipient with the email column data. Is there a simple way or a demo for that ?
Cheers gerhard
Email sending solution in php is doable.
http://hastebin.com/uvabugadap.php
Line 193 adds send email button,
Line 142 is place to write email sending code in php.
Hi Abu,
first thanks for this demo and explanation.
Now I have the following Java script implemented:
<script>
jQuery(document).ready(function(){
jQuery('#list1').jqGrid('navButtonAdd', '#list1_pager',
{
'caption' : 'Email',
'buttonicon' : 'ui-icon-pencil',
'onClickButton': function()
{
window.location.href = "mailto:[email protected]; [email protected]?";
fx_bulk_update("send-email");
},
'position': 'last'
});
});
</script>
My Question is now: How can I get the selected email adesses as Parameter
in the window.location.href function ?? like in my example.
Gerhard
In addition I have changed the code to:
var str = '[email protected]; [email protected]';
window.location.href = "mailto:"+str+"?";
Is it possible to loop all selected rows ?
// array of id's of the selected rows when multiselect options is true. Empty array if not selection
var selr = grid.jqGrid('getGridParam','selarrrow');
var t = '';
for (var x=0;x<selr.length;x++)
{
t += grid.jqGrid('getCell', selr[x], 'email_field')+";";
}
Replace email_field with the column name with emails.
var t will have concat ; string.