Adding reply to instead of sending the email as the user see BT#5316 and #5738

skala
Julio Montoya 12 years ago
parent 79937d95ca
commit c25b1999e5
  1. 4
      main/inc/lib/mail.lib.inc.php
  2. 5
      main/inc/lib/notification.lib.php

@ -80,6 +80,10 @@ function api_mail_html($recipient_name, $recipient_email, $subject, $message, $s
$mail->AddReplyTo($sender_email, $sender_name);
}
if (isset($extra_headers['reply_to'])) {
$mail->AddReplyTo($extra_headers['reply_to']['mail'], $extra_headers['reply_to']['name']);
}
// Attachments
// $mail->AddAttachment($path);
// $mail->AddAttachment($path, $filename);

@ -146,7 +146,10 @@ class Notification extends Model {
if (!empty($user_info['mail'])) {
$name = api_get_person_name($user_info['firstname'], $user_info['lastname']);
if (!empty($sender_info['complete_name']) && !empty($sender_info['email'])) {
api_mail_html($name, $user_info['mail'], Security::filter_terms($title), Security::filter_terms($content), $sender_info['complete_name'], $sender_info['email']);
$extra_headers = array();
$extra_headers['reply_to']['mail'] = $sender_info['email'];
$extra_headers['reply_to']['name'] = $name;
api_mail_html($name, $user_info['mail'], Security::filter_terms($title), Security::filter_terms($content), $this->admin_name, $this->admin_email, $extra_headers);
} else {
api_mail_html($name, $user_info['mail'], Security::filter_terms($title), Security::filter_terms($content), $this->admin_name, $this->admin_email);
}

Loading…
Cancel
Save