| 1 |
<?php |
| 2 |
|
| 3 |
if( isset($_POST["Resason"]) || isset($_POST["TextReason"])) { |
| 4 |
|
| 5 |
$pass = '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'; // not the key, but the token |
| 6 |
|
| 7 |
$url = 'https://api.sendgrid.com/'; |
| 8 |
|
| 9 |
$params = array( |
| 10 |
'to' => 'info@spicethemes.com', |
| 11 |
'subject' => 'Spicepress Theme Feedback', |
| 12 |
'html' => $_POST["Resason"] ." ". $_POST["TextReason"], |
| 13 |
'from' => 'spicepress@spicethemes.com', |
| 14 |
); |
| 15 |
|
| 16 |
$request = $url.'api/mail.send.json'; |
| 17 |
$headr = array(); |
| 18 |
// set authorization header |
| 19 |
$headr[] = 'Authorization: Bearer '.$pass; |
| 20 |
|
| 21 |
$session = curl_init($request); |
| 22 |
curl_setopt ($session, CURLOPT_POST, true); |
| 23 |
curl_setopt ($session, CURLOPT_POSTFIELDS, $params); |
| 24 |
curl_setopt($session, CURLOPT_HEADER, false); |
| 25 |
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); |
| 26 |
|
| 27 |
// add authorization header |
| 28 |
curl_setopt($session, CURLOPT_HTTPHEADER,$headr); |
| 29 |
|
| 30 |
$response = curl_exec($session); |
| 31 |
curl_close($session); |
| 32 |
} |
| 33 |
?> |