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)) {
# 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" .
'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,
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);
return mail_to_user($to, $subject, $body);
}
-
-
function mail_notify_message($message, $from=NULL, $to=NULL) {
if (is_null($from)) {