X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmail.php;h=a7cbab8589665daa7343ce171d892e66d5947037;hb=2abe10b8ea4b5d69fc7f6513bf465541454ca2cf;hp=3280c1b7b770ea79916f9f2e563e3a0ab0af3ec4;hpb=e508fd5b5e1a357742122fb59f84badc91bf740c;p=quix0rs-gnu-social.git diff --git a/lib/mail.php b/lib/mail.php index 3280c1b7b7..a7cbab8589 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -39,6 +39,9 @@ function mail_backend() { function mail_send($recipients, $headers, $body) { $backend = mail_backend(); + if (!isset($headers['Content-Type'])) { + $headers['Content-Type'] = 'text/plain; charset=UTF-8'; + } assert($backend); # throws an error if it's bad $sent = $backend->send($recipients, $headers, $body); if (PEAR::isError($sent)) { @@ -82,8 +85,8 @@ function mail_to_user(&$user, $subject, $body, $address=NULL) { # For confirming a Jabber address -function mail_confirm_address($code, $nickname, $address) { - $user = common_current_user(); +function mail_confirm_address($user, $code, $nickname, $address) { + $subject = _('Email address confirmation'); $body = sprintf(_("Hey, %s.\n\nSomeone just entered this email address on %s.\n\n" . @@ -164,7 +167,8 @@ function mail_broadcast_notice_sms($notice) { 'ON user.id = subscription.subscriber ' . 'WHERE subscription.subscribed = ' . $notice->profile_id . ' ' . 'AND user.smsemail IS NOT NULL ' . - 'AND user.smsnotify = 1'); + 'AND user.smsnotify = 1 ' . + 'AND subscription.sms = 1 '); while ($user->fetch()) { common_log(LOG_INFO, @@ -223,7 +227,6 @@ function mail_confirm_sms($code, $nickname, $address) { mail_send($recipients, $headers, $body); } - function mail_notify_nudge($from, $to) { common_init_locale($to->language); $subject = sprintf(_('You\'ve been nudged by %s'), $from->nickname); @@ -244,8 +247,6 @@ function mail_notify_nudge($from, $to) { return mail_to_user($to, $subject, $body); } - - function mail_notify_message($message, $from=NULL, $to=NULL) { if (is_null($from)) {