Commit | Line | Data |
---|---|---|
c4f9ed02 PM |
1 | <?PHP |
2 | include_once('../email.php'); | |
64feb164 | 3 | |
431f376b | 4 | $base_message = "I just wanted to take a second and follow up with your visit to md-petition.com and |
1e7a4bde PM |
5 | see if you needed anything or had any questions? You should have received an |
6 | alert 'Petition Signed' when you finished signing the petition and had the option to print a signed copy. | |
7 | If you did not receive the alert and would like help, let me know. The invite link is below to try again."; | |
c4f9ed02 PM |
8 | |
9 | // USAGE meps_mail('Patrick <baltimorehacker@gmail.com>','','Petition Follow-Up'); | |
10 | ||
64feb164 | 11 | $q="SELECT * FROM follow_up where status = 'NEW'"; |
c4f9ed02 PM |
12 | $r = $petition->query($q); |
13 | while($d = mysqli_fetch_array($r)){ | |
64feb164 | 14 | $name = $d['name']; |
91445973 | 15 | $email = $d['email']; |
64feb164 PM |
16 | $q2 = "SELECT * FROM presign where php_session_id = '$d[php_session]'"; |
17 | $r2 = $petition->query($q2); | |
91445973 | 18 | $presign = mysqli_fetch_array($r2); |
64feb164 | 19 | $visit = $presign['action_on']; |
91445973 PM |
20 | $invite=''; |
21 | $petition_name='Maryland'; | |
22 | if($d['petition_id'] != '0'){ | |
23 | $q2 = "SELECT * FROM petitions where petition_id = '$d[petition_id]'"; | |
24 | $r2 = $petition->query($q2); | |
25 | $petitions = mysqli_fetch_array($r2); | |
26 | $petition_name = $petitions['petition_name']; | |
27 | $landing_page = $petitions['landing_page']; | |
28 | $web_short_name = $petitions['web_short_name']; | |
29 | $link = 'https://www.md-petition.com/?invite='.$web_short_name; | |
30 | if ($landing_page != ''){ | |
31 | $link = 'https://www.md-petition.com/'.$landing_page; | |
32 | } | |
33 | $invite = "<br><br>Petition: $petition_name at <a href='$link'>$link</a>"; | |
64feb164 | 34 | } |
64feb164 PM |
35 | $last = "<br><br>Follow up was requested at $visit"; |
36 | $body = $base_message.$invite.$last; | |
37 | $subject = "$petition_name Petition Follow-Up"; | |
38 | $to = "$name <$email>"; | |
39 | $feedback_message = "TO: $to SUB: $subject MSG: $body sent on ".date('r')." by ".$_COOKIE['name']; | |
850093f5 | 40 | meps_mail($to,$body,$subject); |
64feb164 | 41 | $feedback_message = $petition->real_escape_string($feedback_message); |
850093f5 | 42 | $petition->query("update follow_up set status = 'sent', feedback_message = '$feedback_message' where id = '$d[id]' "); |
c4f9ed02 PM |
43 | } |
44 | ||
45 | ?> |