|
|
|
@ -82,6 +82,24 @@ try {
|
|
|
|
|
// get paid
|
|
|
|
|
$intent->capture();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$mail = new Email();
|
|
|
|
|
$emailsettings = $_SETTINGS["email"];
|
|
|
|
|
$mail->setSMTP($emailsettings["server"], $emailsettings["port"], true, $emailsettings["user"], $emailsettings["password"], $emailsettings["security"]);
|
|
|
|
|
$mail->setFrom("certifiedfromhome@helena.express", "CertifiedFromHome.com");
|
|
|
|
|
$mail->addTo($shipment->from_address->email);
|
|
|
|
|
$mail->setSubject("Your CertifiedFromHome Receipt");
|
|
|
|
|
$body = "Thanks for using CertifiedFromHome.com!\r\nYour card has been charged a total of $" . number_format($price, 2) . ".\r\n";
|
|
|
|
|
if (!empty($shipment->options->certified_mail)) {
|
|
|
|
|
$body .= "You can track your letter with this tracking code: " . $shipment->tracking_code . "\r\n";
|
|
|
|
|
}
|
|
|
|
|
$body .= "If you need any help, just reply to this email. Thanks again!";
|
|
|
|
|
$mail->setBody($body);
|
|
|
|
|
$mail->send();
|
|
|
|
|
} catch (Exception $ex) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
header("Content-Type: application/json");
|
|
|
|
|
exit(json_encode([
|
|
|
|
|
"status" => "OK",
|
|
|
|
|