function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hoagieryderhoagieryder 

Help with iCal Meeting Request Update

I am trying to develop an e-mail that is sent to request a meeting date that updates the user's e-mail calendar using an ical file. I have everything working perfectly, except when I try to modify a previous request. For instance if I send a request for a meeting on Sept 12th, and the meeting date changes I would like for it to be moved on the user's calendar, not for a new appointment to be added. I have been messing around with sequences and nothing has helped. I am opening these e-mail through Groupwise not Outlook. Any ideas?

 

First Meeting Request:

public class SendEmail{
  

   public String sendTo { get; set; }    
   public SendEmail() {}   
   public PageReference sendinvite()  
 {        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
               String[] toAddresses = new String[] {sendTo}; 
               mail.setToAddresses(toAddresses);
               mail.setSubject('Meeting Invitation');
               mail.setPlainTextBody('');     
               Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();   
               attach.filename = 'quarter1meeting.ics'; 
               attach.ContentType = 'text/calendar';     
               attach.inline = true;     
               attach.body = invite();   
               mail.setFileAttachments(new Messaging.EmailFileAttachment[] {attach});   
               Messaging.SendEmailResult[] er = Messaging.sendEmail(new Messaging.Email[] { mail });   
               return null;    }
              
               private Blob invite() {
        String txtInvite = '';

        txtInvite += 'BEGIN:VCALENDAR\n';
        txtInvite += 'PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN\n';
        txtInvite += 'VERSION:2.0\n';
        txtInvite += 'METHOD:REQUEST\n';
        txtInvite += 'X-MS-OLK-FORCEINSPECTOROPEN:TRUE\n';
        txtInvite += 'BEGIN:VEVENT\n';
        txtInvite += 'CLASS:PUBLIC\n';
        txtInvite += 'UID:12345abz@darconsulting.com\n';
        txtInvite += 'SEQUENCE:0\n';
        txtInvite += 'ORGANIZER:bababa@gmail.com\n';
        txtInvite += 'DTSTAMP:20100804T120000Z\n';
        txtInvite += 'CREATED:20100804T100000Z\n';
        txtInvite += 'DTSTART:20100926T080000Z\n';
        txtInvite += 'LOCATION:Online\n';
        txtInvite += 'PRIORITY:5\n';
        txtInvite += 'SUMMARY;';
        txtInvite += 'LANGUAGE=en-us:Salesforce Test\n';
        txtInvite += 'TRANSP:OPAQUE\n';
        txtInvite += 'X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD><META NAME="Generator" CONTENT="MS Exchange Server version 08.00.0681.000"><TITLE></TITLE></HEAD><BODY><!-- Converted from text/plain format --></BODY></HTML>\n';
        txtInvite += 'X-MICROSOFT-CDO-BUSYSTATUS:BUSY\n';
        txtInvite += 'X-MICROSOFT-CDO-IMPORTANCE:1\n';
        txtInvite += 'END:VEVENT\n';
        txtInvite += 'END:VCALENDAR';

        return Blob.valueOf(txtInvite);
    }

               }

 

 

2nd Request w/ New Date:

public class SendEmail{
  

   public String sendTo { get; set; }    
   public SendEmail() {}   
   public PageReference sendinvite()  
 {        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
               String[] toAddresses = new String[] {sendTo}; 
               mail.setToAddresses(toAddresses);
               mail.setSubject('Meeting Invitation');
               mail.setPlainTextBody('');     
               Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();   
               attach.filename = 'quarter1meeting.ics'; 
               attach.ContentType = 'text/calendar';     
               attach.inline = true;     
               attach.body = invite();   
               mail.setFileAttachments(new Messaging.EmailFileAttachment[] {attach});   
               Messaging.SendEmailResult[] er = Messaging.sendEmail(new Messaging.Email[] { mail });   
               return null;    }
              
               private Blob invite() {
        String txtInvite = '';

        txtInvite += 'BEGIN:VCALENDAR\n';
        txtInvite += 'PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN\n';
        txtInvite += 'VERSION:2.0\n';
        txtInvite += 'METHOD:REQUEST\n';
        txtInvite += 'X-MS-OLK-FORCEINSPECTOROPEN:TRUE\n';
        txtInvite += 'BEGIN:VEVENT\n';
        txtInvite += 'CLASS:PUBLIC\n';
        txtInvite += 'UID:12345abz@darconsulting.com\n';
        txtInvite += 'SEQUENCE:1\n';
        txtInvite += 'ORGANIZER:bababa@gmail.com\n';
        txtInvite += 'DTSTAMP:20100805T120000Z\n';
        txtInvite += 'CREATED:20100804T100000Z\n';
        txtInvite += 'DTSTART:20100930T080000Z\n';
        txtInvite += 'LOCATION:Online\n';
        txtInvite += 'PRIORITY:5\n';
        txtInvite += 'SUMMARY;';
        txtInvite += 'LANGUAGE=en-us:Salesforce Test\n';
        txtInvite += 'TRANSP:OPAQUE\n';
        txtInvite += 'X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD><META NAME="Generator" CONTENT="MS Exchange Server version 08.00.0681.000"><TITLE></TITLE></HEAD><BODY><!-- Converted from text/plain format --></BODY></HTML>\n';
        txtInvite += 'X-MICROSOFT-CDO-BUSYSTATUS:BUSY\n';
        txtInvite += 'X-MICROSOFT-CDO-IMPORTANCE:1\n';
        txtInvite += 'END:VEVENT\n';
        txtInvite += 'END:VCALENDAR';

        return Blob.valueOf(txtInvite);
    }

               }

vendotivendoti

Hello ,

 

Did you find any solution about updating the calendar invite. If so please share me the details.

 

Thanks In Advance,

Vendoti.

 

 

AlkaAlka
Is Any one get the Solution for this I have the issue in ical while i sending the update Meeting is not created /updated in google calendar and when I click on add to calendar duplicate meeting is created. Please help me out I stuck in it from last 1 week.