Create search.php
[clinton/MarylandElectronicPetitionSignature.git] / admin / follow_up_emails.php
index c6fd2b9..b14f79e 100644 (file)
@@ -2,10 +2,9 @@
 include_once('../email.php');
 
 $base_message = "I just wanted to take a second and follow up with your visit to md-petition.com and
-see if you needed anything, or had any questions. You indicated a follow up if we did not receive your
-completed petition. The software flagged your session, and we had a human review. You should receive an
-alert 'Petition Signed' when complete. If you would like, please retry and if you continue to have trouble
-I will work to fix it ASAP.";
+see if you needed anything or had any questions? You should have received an
+alert 'Petition Signed' when you finished signing the petition and had the option to print a signed copy.
+If you did not receive the alert and would like help, let me know. The invite link is below to try again.";
 
 // USAGE meps_mail('Patrick <baltimorehacker@gmail.com>','','Petition Follow-Up');
 
@@ -33,14 +32,15 @@ while($d = mysqli_fetch_array($r)){
     }
     $invite = "<br><br>Petition: $petition_name at <a href='$link'>$link</a>";
   }
-  $last = "<br><br>Follow up was requested at $visit";
-  $body = $base_message.$invite.$last;
-  $subject = "$petition_name Petition Follow-Up";
-  $to = "$name <$email>";
+  $last             = "<br><br>Follow up was requested at $visit";
+  $body             = $base_message.$invite.$last;
+  $subject          = "$petition_name Petition Follow-Up";
+  $to               = "$name <$email>";
   $feedback_message = "TO: $to SUB: $subject MSG: $body sent on ".date('r')." by ".$_COOKIE['name'];
-  meps_mail($to,$body,$subject);
+  $response         = meps_mail($to,$body,$subject);
   $feedback_message = $petition->real_escape_string($feedback_message);
-  $petition->query("update follow_up set status = 'sent', feedback_message = '$feedback_message' where id = '$d[id]'  ");
+  $response         = $petition->real_escape_string($response);
+  $petition->query("update follow_up set status = 'sent', feedback_message = '$feedback_message', system_response='$response' where id = '$d[id]'  ");
 }
-
+header('Location: /admin/follow_up_success.php');
 ?>