Revision
2831
Author
cimorrison
Date
2014-04-27 17:10:08 +0000 (Sun, 27 Apr 2014)

Log Message

Changed the ORGANIZER in an iCalendar event to be a new email address, defined as $mail_settings['organizer'] and not the creator.   This is to avoid a problem in some mail systems, eg IBM Domino, where an iCalendar event notification email is silently discarded if the organizer's email address is the same as the recipient's

Modified Paths

Diff

Modified: mrbs/trunk/web/functions_ical.inc (2830 => 2831)


--- mrbs/trunk/web/functions_ical.inc	2014-04-27 10:06:45 UTC (rev 2830)
+++ mrbs/trunk/web/functions_ical.inc	2014-04-27 17:10:08 UTC (rev 2831)
@@ -926,28 +926,17 @@
   */
   
   // ORGANIZER
-  // The organizer is the booking creator if we've got an email address for him/her.
-  // Otherwise we'll make the 'from' address the organizer.   In both cases we'll try
-  // and extract the common name from the email address.
-  $organizer_email = get_email_address($data['create_by']);
-  if (empty($organizer_email))
+  // The organizer is MRBS.   We don't make the create_by user the organizer because there
+  // are some mail systems such as IBM Domino that silently discard the email notification
+  // if the organizer's email address is the same as the recipient's - presumably because
+  // they assume that the recipient already knows about the event.
+
+  $organizer = parse_address($mail_settings['organizer']);
+  if (empty($organizer['common_name']))
   {
-    $organizer = parse_address($addresses['from']);
-    if (empty($organizer['common_name']))
-    {
-      $organizer['common_name'] = $organizer['address'];
-    }
+    $organizer['common_name'] = get_mail_vocab('mrbs');
   }
-  else
-  {
-    $organizer = parse_address($organizer_email);
-    if (empty($organizer['common_name']))
-    {
-      // If the email address doesn't have a common name
-      // then we can use the creator's username
-      $organizer['common_name'] = $data['create_by'];
-    }
-  }
+  
   if (!empty($organizer['address']))
   {
     $results[] = "ORGANIZER;CN=\"" . ical_escape_quoted_string($organizer['common_name']) . "\":mailto:" . $organizer['address'];

Modified: mrbs/trunk/web/systemdefaults.inc.php (2830 => 2831)


--- mrbs/trunk/web/systemdefaults.inc.php	2014-04-27 10:06:45 UTC (rev 2830)
+++ mrbs/trunk/web/systemdefaults.inc.php	2014-04-27 17:10:08 UTC (rev 2831)
@@ -998,6 +998,13 @@
 // Set the email address of the From field. Default is 'admin_email@your.org'
 $mail_settings['from'] = 'admin_email@your.org';
 
+// The address to be used for the ORGANIZER in an iCalendar event.   Do not make
+// this email address the same as the admin email address or the recipients 
+// email address because on some mail systems, eg IBM Domino, the iCalendar email
+// notification is silently discarded if the organizer's email address is the same 
+// as the recipient's.
+$mail_settings['organizer'] = 'mrbs@your.org';
+
 // Set the recipient email. Default is 'admin_email@your.org'. You can define
 // more than one recipient like this "john@doe.com,scott@tiger.com"
 $mail_settings['recipients'] = 'admin_email@your.org';