This topic is locked

Send simple email if a field checked off.

1/18/2018 2:58:05 PM
PHPRunner General questions
A
ashumak author

Hi,
I have a form that has two check boxes, when either is checked off for the first time, I want to send a simple email stating a task is completed.

I know to use events, after record updated...but what adjustments would be needed...
Any help appreciated...

romaldus 1/20/2018

what kind of adjustment do you need?

mbintex 1/20/2018

have a look at
runner_mail
function in the manual.
https://xlinesoft.com/phprunner/docs/runner_mail_function.htm

romaldus 1/20/2018

in add or edit page, in after record added event:



if ($values['field1'] == '0' && $values['field2'] == '0')

{
//your send mail code here
}
A
ashumak author 1/22/2018



in add or edit page, in after record added event:



if ($values['field1'] == '0' && $values['field2'] == '0')

{
//your send mail code here
}




Hi,
That worked, but i want to send two different Subjects on the emails, one if it's one box checked, a different one if another.

As well, this sends an email message everytime the item is edited. I need for just the first time it is checked off.

Modify it some way???
If ($values['send_deploy'] == '1' && $values['send_finance'] == '1')

$email="aj@payplus.ca";

$from="info@payplus.ca";

$msg="";

$subject="Ready to Setup or Sent to Finance";
$msg.= "DBA_NAME: ".$values["DBA_NAME"]."\r\n";

$msg.= "MID: ".$values["MID"]."\r\n";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"];
AJ