From 3d0d3a86106ece4ea298ab2f262b3af5ff8a7728 Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Sat, 11 Mar 2017 01:29:13 -0800 Subject: Almost there... --- inc/app_eml.tpl | 4 ++-- inc/functions.php | 18 +++++++++++------- inc/hire_eml.tpl | 23 +++++++++++++++++++++++ inc/user.php | 2 +- 4 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 inc/hire_eml.tpl (limited to 'inc') diff --git a/inc/app_eml.tpl b/inc/app_eml.tpl index b788f93..779e242 100644 --- a/inc/app_eml.tpl +++ b/inc/app_eml.tpl @@ -2,7 +2,7 @@ - Active Your Bulletin Account + Job Application Received
-

Your Ad, [tpl:adname], has just received a response. The applicant is named [tpl:seekername] and [tpl:seekerrating]. To get in touch, you can check out more of their profile, you can email them at [tpl:seekereml], or check out more of their profile here.

+

Your Ad, [tpl:adname], has just received a response. The applicant is named [tpl:seekername] and [tpl:seekerrating]. To get in touch, you can email them at [tpl:seekereml] or check out more of their profile here.

diff --git a/inc/functions.php b/inc/functions.php index ca43d85..12bf2fc 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -72,12 +72,16 @@ function bulletin_hash ($str, $salt = '') { function bulletin_mail ($to, $subject, $body) { global $b_config; - $mg = new Mailgun\Mailgun($b_config['mg_key']); - return $mg->sendMessage($b_config['mg_dom'], array( - 'from' => $b_config['mail_from'], - 'to' => $to, - 'subject' => $subject, - 'html' => $body, - )); + try { + $mg = new Mailgun\Mailgun($b_config['mg_key']); + return $mg->sendMessage($b_config['mg_dom'], array( + 'from' => $b_config['mail_from'], + 'to' => $to, + 'subject' => $subject, + 'html' => $body, + )); + } catch (Exception $e) { + return 0; + } } ?> diff --git a/inc/hire_eml.tpl b/inc/hire_eml.tpl new file mode 100644 index 0000000..86fbb33 --- /dev/null +++ b/inc/hire_eml.tpl @@ -0,0 +1,23 @@ + + + + + Job Application Selected + + + +
+
+

[tpl:providername] has selected you for their ad, [tpl:adtitle]. If you have any questions, please review the job description, contact the job provider at [tpl:provideremail], or pay a visit to their profile.

+

Once the job is complete, please rate your experience with this provider under the rate tab.

+
+
+
+[config:eml_footer] +

Copyright © 2016 Bulletin Team

+ + diff --git a/inc/user.php b/inc/user.php index 878a086..70bc646 100644 --- a/inc/user.php +++ b/inc/user.php @@ -9,7 +9,7 @@ if (empty($_COOKIE[$b_config['c_name']]) || !preg_match('/^(\d+);([0-9a-zA-Z\.]+ } else { $db = new bdb(); - $result = $db->query('SELECT users.*, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM users LEFT JOIN ratings ON ratings.rated = users.id WHERE users.id = '.intval($matches[1]).' AND users.session = \''.bulletin_hash($matches[2]).'\' AND users.active = 1 LIMIT 1') or fatal($db->error); + $result = $db->query('SELECT users.*, SUM(ratings.stars) / COUNT(ratings.stars) AS rating, COUNT(notif.id) AS notif FROM users LEFT JOIN ratings ON ratings.rated = users.id LEFT JOIN notif ON notif.uid = users.id AND notif.seen = 0 WHERE users.id = '.intval($matches[1]).' AND users.session = \''.bulletin_hash($matches[2]).'\' AND users.active = 1 GROUP BY users.id LIMIT 1') or fatal($db->error); if ($result->num_rows < 1) $b_user = $guest_user; else $b_user = $result->fetch_assoc(); $result->free(); -- cgit v1.2.3