-Don't append RSVP weblinks on information updates which don't require a response (#3446)
This commit is contained in:
parent
8238c5ac8b
commit
9496f4f820
3 changed files with 7 additions and 5 deletions
|
@ -1800,13 +1800,14 @@ class calendar extends rcube_plugin
|
|||
|
||||
// which template to use for mail text
|
||||
$is_new = !in_array($attendee['email'], $old_attendees);
|
||||
$is_rsvp = $is_new || $event['sequence'] > $old['sequence'];
|
||||
$bodytext = $is_cancelled ? 'eventcancelmailbody' : ($is_new ? 'invitationmailbody' : 'eventupdatemailbody');
|
||||
$subject = $is_cancelled ? 'eventcancelsubject' : ($is_new ? 'invitationsubject' : ($event['title'] ? 'eventupdatesubject':'eventupdatesubjectempty'));
|
||||
|
||||
$event['comment'] = $comment;
|
||||
|
||||
// finally send the message
|
||||
if ($itip->send_itip_message($event, $method, $attendee, $subject, $bodytext, $message))
|
||||
if ($itip->send_itip_message($event, $method, $attendee, $subject, $bodytext, $message, $is_rsvp))
|
||||
$sent++;
|
||||
else
|
||||
$sent = -100;
|
||||
|
|
|
@ -92,7 +92,7 @@ class libcalendaring_itip
|
|||
* @param object Mail_mime object with message data
|
||||
* @return boolean True on success, false on failure
|
||||
*/
|
||||
public function send_itip_message($event, $method, $recipient, $subject, $bodytext, $message = null)
|
||||
public function send_itip_message($event, $method, $recipient, $subject, $bodytext, $message = null, $rsvp = true)
|
||||
{
|
||||
if (!$this->sender['name'])
|
||||
$this->sender['name'] = $this->sender['email'];
|
||||
|
@ -125,7 +125,7 @@ class libcalendaring_itip
|
|||
'vars' => array(
|
||||
'title' => $event['title'],
|
||||
'date' => $this->lib->event_date_text($event, true),
|
||||
'attendees' => join(', ', $attendees_list),
|
||||
'attendees' => join(",\n ", $attendees_list),
|
||||
'sender' => $this->sender['name'],
|
||||
'organizer' => $this->sender['name'],
|
||||
)
|
||||
|
@ -136,7 +136,7 @@ class libcalendaring_itip
|
|||
// }
|
||||
|
||||
// append links for direct invitation replies
|
||||
if ($method == 'REQUEST' && ($token = $this->store_invitation($event, $recipient['email']))) {
|
||||
if ($method == 'REQUEST' && $rsvp && ($token = $this->store_invitation($event, $recipient['email']))) {
|
||||
$mailbody .= "\n\n" . $this->gettext(array(
|
||||
'name' => 'invitationattendlinks',
|
||||
'vars' => array('url' => $this->plugin->get_url(array('action' => 'attend', 't' => $token))),
|
||||
|
|
|
@ -734,11 +734,12 @@ class tasklist extends rcube_plugin
|
|||
|
||||
// which template to use for mail text
|
||||
$is_new = !in_array($attendee['email'], $old_attendees);
|
||||
$is_rsvp = $is_new || $task['sequence'] > $old['sequence'];
|
||||
$bodytext = $is_cancelled ? 'itipcancelmailbody' : ($is_new ? 'invitationmailbody' : 'itipupdatemailbody');
|
||||
$subject = $is_cancelled ? 'itipcancelsubject' : ($is_new ? 'invitationsubject' : ($task['title'] ? 'itipupdatesubject' : 'itipupdatesubjectempty'));
|
||||
|
||||
// finally send the message
|
||||
if ($itip->send_itip_message($object, $method, $attendee, $subject, $bodytext, $message))
|
||||
if ($itip->send_itip_message($object, $method, $attendee, $subject, $bodytext, $message, $is_rsvp))
|
||||
$sent++;
|
||||
else
|
||||
$sent = -100;
|
||||
|
|
Loading…
Add table
Reference in a new issue