<?php if (isset($_POST['phone']) && $_POST['phone']) { $success = MailerHelper::mail('*****@*****.**', 'New request to join whatsapp group', $_POST['phone'] . ' requested to join the Tiferes Rachamim WhatsApp group.'); echo json_encode(['successful' => $success]); } else { echo json_encode(['successful' => false]); }
} public function getStatus() { return $this->status; } public function getLastRunTime() { return $this->lastRunTime; } } // Run $medor = new Watchdog($data, false); echo "Running ... "; for ($i = 1; $i < 5; $i++) { $medor->addOutput("<br /><br /><strong>Starting run #" . $i . "</strong><br /><br />"); $medor->run(); if ($medor->getStatus() == true) { break; } } if ($medor->getStatus() != true) { echo "FAILED."; // Send mail $message = sprintf("Last failed watchdog run took %d seconds.\r\n\r\n", $medor->getLastRunTime()); $message .= $medor->getOutput(); // Envoi $status = MailerHelper::sendWatchdogMail($message); } else { echo "OK."; } echo sprintf(" (Run took %d seconds)\r\n", $medor->getLastRunTime());
/** * Remove a spark from the database, and tell it's dreadful author why * we're removing it via email. * @param string $version The version to remove * @param array $errors The things wrong with the spark * @return bool */ public function removeTagAndNotify($tag, $errors) { $this->load->helper('mailer'); $contrib = $this->getContributor(); $sys_email = config_item('system_alert_email'); $message = "Hey there,\n \nThis is an automated message to tell you that tag '{$tag}' of\n{$this->name} couldn't be verified ({$this->base_location}).\nWe've removed that version from our system at getsparks. Once you get\nthings figured out on your end, you can re-add the version :)\n \nHere are some specifics: \n\n"; foreach ($errors as $error) { $message .= "{$error}\n"; } MailerHelper::sendSparkRejection($contrib->email, "{$this->name} {$tag}", $message); $this->db->where('spark_id', $this->id); $this->db->where('tag', $tag); return $this->db->delete('versions'); }
private function emailReceipt($info) { $padLength = 35; $body = ''; if ($info['success']) { $body .= $info['message'] . "\n\n"; $body .= str_pad("Confirmation Number: ", $padLength) . $info['confirmationNumber'] . "\n"; $body .= str_pad("Name: ", $padLength) . ucwords(ucwords($info['fname'] . ' ' . $info['lname'])) . "\n"; $body .= str_pad("Amount: ", $padLength) . $info['resultAmount'] . "\n"; $body .= str_pad("Date: ", $padLength) . $info['clientTransDate'] . "\n"; $body .= str_pad("Authorization Code: ", $padLength) . $info['authCode'] . "\n"; $body .= str_pad("Payment Type: ", $padLength) . ucwords(ucwords($info['paymentType'])) . "\n"; $body .= str_pad("Card Type: ", $padLength) . ucwords(ucwords($info['cardType'])) . "\n"; $body .= str_pad("Last 4 of Account Number: ", $padLength) . $info['last4'] . "\n"; } if (isset($info['subscription'])) { $body .= "\n\nYou have agreed to recurring charges on a monthly basis. You may call Laibie at (347) 403-1660 to cancel the "; $body .= "recurring charges at any time. Please review the information below and contact Laibie immediately if "; $body .= "the information is incorrect.\n\n"; $body .= str_pad("Recurring Subscription ID: ", $padLength) . $info['braintreeSubscriptionId'] . "\n"; $body .= str_pad("Recurring Amount: ", $padLength) . $info['price'] . "\n"; $body .= str_pad("Recurring Day of Month: ", $padLength) . $info['billingDayOfMonth'] . "\n"; $body .= str_pad("Recurring Subscription Status: ", $padLength) . ucwords(ucwords($info['status'])) . "\n"; } if (strlen($body) <= 0) { MysqlAccess::log("Attempted to email empty text to " . $info['email']); return; } MailerHelper::mail($info['email'], $info['header'], $body); }
<?php require_once '../../config.php'; require_once _PATH . 'include/mail/mailHelper.class.php'; // We verify the referer if (isset($_SERVER["HTTP_REFERER"]) && strpos($_SERVER["HTTP_REFERER"], _SITE_URL) !== false) { if (isset($_POST['mail']) && $_POST['mail'] != "" && isset($_POST['message']) && $_POST['message'] != "") { $success = MailerHelper::sendMail($_POST['mail'], $_POST['message']); if ($success) { echo "1"; return; } } } echo "0";