NEW file
This commit is contained in:
parent
b97836f1bc
commit
593b99e8f6
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
$fName = $_POST['firstname'];
|
||||
$lName = $_POST['lastname'];
|
||||
$email = $_POST['email'];
|
||||
$phone = $_POST['phonenumber'];
|
||||
$message = $_POST['message'];
|
||||
|
||||
$response = sendEmail(
|
||||
$fName,
|
||||
$lName,
|
||||
$email,
|
||||
$phone,
|
||||
$message,
|
||||
);
|
||||
$array = json_decode($response,true);
|
||||
var_dump($array);
|
||||
header("location: contact-us-test.php");
|
File diff suppressed because it is too large
Load Diff
|
@ -446,6 +446,65 @@ function vendorExists($email)
|
|||
return $count;
|
||||
}
|
||||
|
||||
|
||||
function sendEmail($fName, $lName, $email, $phone, $message)
|
||||
{
|
||||
$email2 = "stacyjoycemapano@gmail.com";
|
||||
$message2 = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
<li style='list-style:none; font-size:13px'><b>Name: </b>$fName $lName</li>
|
||||
<li style='list-style:none; font-size:13px'><b>Email: </b>$email</li>
|
||||
<li style='list-style:none; font-size:13px'><b>Phone: </b>$phone</li>
|
||||
<br>
|
||||
<li style='list-style:none; font-size:13px'><b>Message: </b>$message</li>
|
||||
</ul>";
|
||||
$data = [
|
||||
"Messages" => [
|
||||
[
|
||||
"From" => [
|
||||
"Email" => "webdev@obanana.com",
|
||||
"Name" => "Obanana B2B"
|
||||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $email2,
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
"Subject" => "Obanana Contact Us Form",
|
||||
"TextPart" => "Greetings from Obanana!",
|
||||
"HTMLPart" => $message2
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$json = json_encode($data);
|
||||
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.mailjet.com/v3.1/send',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Basic ODA4MDc4ZThjMDA4NjVhYzU4MTcyNDJjNTMxY2JlZGU6MGQ4ODg3ZTdiZjY1ZWNkMmQ0NzdiOWJhZGIyYTJhY2Q='
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
function sendOTP($email)
|
||||
{
|
||||
$email2 = "junjihadbarroga@gmail.com";
|
||||
|
|
Loading…
Reference in New Issue