diff options
| author | Carson Fleming <cflems@cflems.net> | 2017-02-28 17:37:57 -0500 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2017-02-28 17:37:57 -0500 |
| commit | a8f3669b4ea82f48edbca69742364adf2794e07f (patch) | |
| tree | b2668a0a31623a578a16622a5da6b0c924b3c071 /inc/functions.php | |
| parent | 3bfe03a6f6136947eb8b9c714306d080ce889af7 (diff) | |
| download | bulletin-a8f3669b4ea82f48edbca69742364adf2794e07f.tar.gz | |
Modularized email and hashing
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 16 |
1 files changed, 16 insertions, 0 deletions
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, + )); +} ?> |
