From a8f3669b4ea82f48edbca69742364adf2794e07f Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Tue, 28 Feb 2017 17:37:57 -0500 Subject: Modularized email and hashing --- inc/functions.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 4793d3d..ca43d85 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -64,4 +64,20 @@ function redirect ($url) { header('Location: '.$url); fatal('Redirecting...', $url); } + +function bulletin_hash ($str, $salt = '') { + return hash('sha512', $str); +} + +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, + )); +} ?> -- cgit v1.2.3