This topic is locked
[SOLVED]

 Send a mail to selected users in a list

6/1/2010 7:38:40 AM
PHPRunner General questions
N
netmedia59 author

Hello,
Is there a way to send a mail to selected users in a list ?

Thanks
Olivier
Lille (FRANCE)

A
ann 6/1/2010

Hi,
to send an email to selected users on the list page you need to create new button.

Here is a sample:

http://xlinesoft.com/phprunner/docs/email_selected_records.htm

In your case you should concat $email values instead of $body.

N
netmedia59 author 6/1/2010

Hey,
Thanks for the answer !

But what I want to do is to send, for example, an ID and a password to the selected users at their mail
For example, in my Table docky_prod, i have some fields :

Num (key)

Email

ID

Password
If I select multiple records, I want to send them a UNIQUE email containing their ID & Password

Don't know if it's clear enough ?
Thanks again !
Olivier

Lille (FRANCE)



Hi,
to send an email to selected users on the list page you need to create new button.

Here is a sample:

http://xlinesoft.com/phprunner/docs/email_selected_records.htm

In your case you should concat $email values instead of $body.

J
Jane 6/1/2010

Olivier,
use List page: Before delete event for this purpose.

Here is just a sample:

global $dal;
//delete records

if(@$_POST["a"]=="delete")

return true;
//send emails
if(@$_POST["a"]=="email")

{

// send the email

$email=$deleted_values["Email"];

$subject="Sample subject";

$body = "ID: ".$deleted_values["ID"]."\r\n";

$body.= "Password: ".$deleted_values["Password"]."\r\n";

$arr = runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $body));

}

return false;



Please note you need to add custom button as well:

<INPUT class=button onclick="var form = $('#frmAdmin1')[0]; form.a.value='email'; form.submit(); return false;" value="Email selected" type=button>
N
netmedia59 author 6/1/2010

Yahhhhhhhhhh,
Thank you very much Jane

I kwew it was "Before Delete" but didn't know how to manage it

It works like a charm !!
Olivier