Compare commits
No commits in common. "7bf2701865e365096de2f2b2d66129e0c83f385b" and "e8ef31d86fe8ea1a808d4a7868e26082155039b5" have entirely different histories.
7bf2701865
...
e8ef31d86f
@ -7,7 +7,6 @@ class Email {
|
|||||||
|
|
||||||
private $subject = "";
|
private $subject = "";
|
||||||
private $body = "";
|
private $body = "";
|
||||||
private $html = "";
|
|
||||||
private $attachments = [];
|
private $attachments = [];
|
||||||
private $to = [];
|
private $to = [];
|
||||||
private $fromaddress = "";
|
private $fromaddress = "";
|
||||||
@ -18,7 +17,6 @@ class Email {
|
|||||||
private $smtpusername = "";
|
private $smtpusername = "";
|
||||||
private $smtppassword = "";
|
private $smtppassword = "";
|
||||||
private $smtpsecurity = "";
|
private $smtpsecurity = "";
|
||||||
private $replyto = "";
|
|
||||||
|
|
||||||
public function setFrom(string $address, string $name = "") {
|
public function setFrom(string $address, string $name = "") {
|
||||||
$this->fromaddress = $address;
|
$this->fromaddress = $address;
|
||||||
@ -37,18 +35,10 @@ class Email {
|
|||||||
$this->body = $body;
|
$this->body = $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setHtmlBody(string $html) {
|
|
||||||
$this->html = $html;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addAttachment(string $filename, string $name = "") {
|
public function addAttachment(string $filename, string $name = "") {
|
||||||
$this->attachments[$filename] = $name;
|
$this->attachments[$filename] = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setReplyTo(string $em) {
|
|
||||||
$this->replyto = $em;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addTo(string $email) {
|
public function addTo(string $email) {
|
||||||
$this->to[] = $email;
|
$this->to[] = $email;
|
||||||
}
|
}
|
||||||
@ -89,24 +79,10 @@ class Email {
|
|||||||
$mail->SMTPSecure = $this->smtpsecurity;
|
$mail->SMTPSecure = $this->smtpsecurity;
|
||||||
}
|
}
|
||||||
$mail->Port = $this->smtpport;
|
$mail->Port = $this->smtpport;
|
||||||
|
$mail->isHTML(false);
|
||||||
if (empty($this->html)) {
|
|
||||||
$mail->isHTML(false);
|
|
||||||
$mail->CharSet = "text/plain; charset=UTF-8;";
|
|
||||||
$mail->Body = $this->body;
|
|
||||||
} else {
|
|
||||||
$mail->isHTML(true);
|
|
||||||
$mail->CharSet = "text/html; charset=UTF-8;";
|
|
||||||
$mail->Body = $this->html;
|
|
||||||
$mail->AltBody = $this->body;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mail->setFrom($this->fromaddress, $this->fromname);
|
$mail->setFrom($this->fromaddress, $this->fromname);
|
||||||
|
|
||||||
if (!empty($this->replyto)) {
|
|
||||||
$mail->addReplyTo($this->replyto);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($this->to as $to) {
|
foreach ($this->to as $to) {
|
||||||
$mail->addAddress($to);
|
$mail->addAddress($to);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,12 @@ try {
|
|||||||
if ($rate->id == $_REQUEST["rateid"]) {
|
if ($rate->id == $_REQUEST["rateid"]) {
|
||||||
$cost = $rate->rate;
|
$cost = $rate->rate;
|
||||||
$retail_rate = $rate->retail_rate ?? ($rate->list_rate ?? $rate->rate);
|
$retail_rate = $rate->retail_rate ?? ($rate->list_rate ?? $rate->rate);
|
||||||
$price = $retail_rate + 1.00;
|
if ($retail_rate - $cost > 3) {
|
||||||
|
// Cap at $3 profit to be nice
|
||||||
|
$price = $cost + 3.00;
|
||||||
|
} else {
|
||||||
|
$price = $cost + 1.00;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,9 +192,6 @@ try {
|
|||||||
$emailsettings = $_SETTINGS["email"];
|
$emailsettings = $_SETTINGS["email"];
|
||||||
$mail->setSMTP($emailsettings["server"], $emailsettings["port"], true, $emailsettings["user"], $emailsettings["password"], $emailsettings["security"]);
|
$mail->setSMTP($emailsettings["server"], $emailsettings["port"], true, $emailsettings["user"], $emailsettings["password"], $emailsettings["security"]);
|
||||||
$mail->setFrom($emailsettings["user"], "CertifiedFromHome.com");
|
$mail->setFrom($emailsettings["user"], "CertifiedFromHome.com");
|
||||||
if (!empty($emailsettings["replyto"])) {
|
|
||||||
$mail->setReplyTo($emailsettings["replyto"]);
|
|
||||||
}
|
|
||||||
$mail->addTo($shipment->from_address->email);
|
$mail->addTo($shipment->from_address->email);
|
||||||
$mail->setSubject("Your CertifiedFromHome Receipt");
|
$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";
|
$body = "Thanks for using CertifiedFromHome.com!\r\nYour card has been charged a total of $" . number_format($price, 2) . ".\r\n";
|
||||||
|
|||||||
@ -9,7 +9,6 @@ $_SETTINGS = [
|
|||||||
"server" => "mail.netsyms.net",
|
"server" => "mail.netsyms.net",
|
||||||
"port" => 587,
|
"port" => 587,
|
||||||
"user" => "noreply@netsyms.com",
|
"user" => "noreply@netsyms.com",
|
||||||
"replyto" => "reply@netsyms.com",
|
|
||||||
"password" => "",
|
"password" => "",
|
||||||
"security" => "tls"
|
"security" => "tls"
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user