-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtea-reg.php
40 lines (34 loc) · 1.56 KB
/
tea-reg.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$mail = $_POST['email'];
$phone = $_POST['phone'];
$age = $_POST['age'];
$dob = $_POST['dob'];
$aviation = $_POST['aviation'];
$beauty = $_POST['beauty'];
$english = $_POST['english'];
$exp = $_POST['exp'];
$personal = $_POST['personal'];
$content = "Name: " . $name . "<br>" . "Email: " . $mail . "<br>" . "Phone: " . $phone . "<br>" . "Age: " . $age . "<br>" . "DOB: " . $dob . "<br>" . "Specialised category: " . "Aviation: " . $aviation . "<br>" . "Beauty: " . $beauty . "English: " . $english . "<br>" . "Relevant Experience: " . $exp . "<br>" . "Personal Experience: " . $personal;
}
// require("vendor/autoload.php"); // If you're using Composer (recommended)
require("sendgrid-php/sendgrid-php.php");
$email = new \SendGrid\Mail\Mail();
$email->setFrom("[email protected]", "Course Bees - Teacher Registration");
$email->setSubject("Teacher Registration");
$email->addTo("[email protected]", "Course Bees - Teacher Registration");
$email->addContent(
"text/html", "$content"
);
$sendgrid = new \SendGrid("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");
// getenv('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');
try {
$response = $sendgrid->send($email);
print $response->statusCode() . "\n";
print_r($response->headers());
print $response->body() . "\n";
} catch (Exception $e) {
echo 'Caught exception: '. $e->getMessage() ."\n";
}
header('Location: teacher-registration.php');