NEW file #8

Merged
MarkHipe merged 1 commits from stacy_branch into main 2024-02-15 09:41:56 +08:00
3 changed files with 1389 additions and 0 deletions

19
contact-us-action.php Normal file
View File

@ -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");

1311
contact-us-test.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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";