S
|
stec5345 author 11/4/2015 |
Anybody? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=78210&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> I need to be able to send an email to an email field from another table after record processed event. What would the correct syntax be for this in PHPrunner? Steve |
![]() |
romaldus 11/4/2015 |
Anybody? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=78211&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
|
S
|
stec5345 author 11/8/2015 |
Below is the code I am using to send an email to the session user who created the supportupdate as well as a hard coded address ($email and $email2). I need an additional email to go out to the person who created the original ticket in the support table. The support and supportupdate tables are linked on SupportID. The field that contains the email address however is in the users.UserEmail field. It is the only place the email address exists. My first question would be, do I need to link the users to the support and supportupdate table or do a query of the users table for the email address based on the user ID? At the end of the day, I want the original creator of the support ticket to get emails every time there is an update to a support ticket item. What do you mean with "email field from another table"? You need to explain the details of your database structure |
![]() |
romaldus 11/9/2015 |
Below is the code I am using to send an email to the session user who created the supportupdate as well as a hard coded address ($email and $email2). I need an additional email to go out to the person who created the original ticket in the support table. The support and supportupdate tables are linked on SupportID. The field that contains the email address however is in the users.UserEmail field. It is the only place the email address exists. My first question would be, do I need to link the users to the support and supportupdate table or do a query of the users table for the email address based on the user ID? At the end of the day, I want the original creator of the support ticket to get emails every time there is an update to a support ticket item. (After Record Added to supportupdate) $email=$_SESSION["UserEmail"]; $email2="scurrier@coastaldatadynamics.com"; $sendto=$email . "," . $email2; $from="supportQ@statmedcaredb.com"; $msg=""; $subject="New Support Ticket Added Successfully"; $msg.= "Support ID: ".$values["SupportID"]."\r\n"; $msg.= "Support Created By: ".$values["SupportCreatedBy"]."\r\n"; $msg.= "Update Date: ".$values["SupportUpdateDate"]."\r\n"; $msg.= "Submitted By: ".$values["SupportUpdatedBy"]."\r\n"; $ret=runner_mail(array('to' => $sendto, 'subject' => $subject, 'body' => $msg, 'from'=>$from)); if(!$ret["mailed"]) echo $ret["Email sucessful"]; Does this help? I hope this makes sense.
$_SESSION["UserEmail"] = $data["UserEmail"];
|
S
|
stec5345 author 11/10/2015 |
I have already saved my session value as I am already sending an email to the SESSION user successfully. This is not what I am trying to accomplish. I want to send an email to the person who created the support ticket when a support ticket is updated. So, I need to cross reference this user, who is not necessarily the SESSION user. The value for this user is in the supportupdate.SupportUpdatedBy field. There are three tables at play here.... 1- users, 2- support, and 3- supportupdate. (relations- 1 support ticket to many updates and one User to many tickets). Support items are created in the support table, updates to support ticket items are created in the supportupdate table and user table is reference only for SESSION variable or Username and UserEmail. These SESSION variables have already been set like you suggested. First, you must save user email in session variable. In AfterSuccessfulLogin event: $_SESSION["UserEmail"] = $data["UserEmail"];
|
![]() |
Sergey Kornilov admin 11/10/2015 |
If session variable $_SESSION["UserEmail"] stores email address of the current logged user then you can simply use $_SESSION["UserEmail"] as a default value of SupportCreatedBy field. $values["SupportCreatedBy"]=$_SESSION["UserEmail"]; |
![]() |
romaldus 11/11/2015 |
Yes, as admin said use $values["SupportCreatedBy"]=$_SESSION["UserEmail"]; in before record addedevent. Every time a user fills the data then SupportCreatedBy field will be filled automatically with the value of $_SESSION["UserEmail"] $email=$values["SupportCreatedBy"];
|
S
|
stec5345 author 11/11/2015 |
The $_SESSION email keeps coming up. I am already sending an email to the SESSION user successfully. I don't know how else to explain my need. Is there not a way to have a phone call with you Sergey? Yes, as admin said use $values["SupportCreatedBy"]=$_SESSION["UserEmail"]; in before record addedevent. Every time a user fills the data then SupportCreatedBy field will be filled automatically with the value of $_SESSION["UserEmail"] $email=$values["SupportCreatedBy"];
|
![]() |
Sergey Kornilov admin 11/11/2015 |
Steve, |
![]() |
romaldus 11/11/2015 |
Try this :
|
S
|
stec5345 author 11/12/2015 |
Sending reply to this to support as I do not want to put this on the forum. |
![]() |
Sergey Kornilov admin 11/14/2015 |
This is what worked at the end. $sql = "select SupportCreatedBy from support where SupportID=".$values["SupportID"];
$sendto=$email . "," . $email2;
$sendto=$email . "," . $email2.",".$email3; |