+ Start a Discussion

Sending Calendar Invitation Emails

I am trying to use the new email attachment methods in the winter '10 release to get emails sent from the appointment controller to be sent in an intuitively obvious way such that they will appear as calendar invitations when opened in Outlook, on a blackberry, in gmail, etc.

In the Winter '10: Platform Release Preview Webinar, Sarah Franklin said the following about new email features, "[If] you wanted to send emails that have a calendar attachment in them and have the person receiving the email open that up an go right into their outlook or something… Right now with Winter '10 we are announcing support for that."

If anyone knows how the Force folks were able to achieve this functionality with the new features please let me know.

Here is what I tried:

         Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
        // Create an email attachment   
        Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
        efa.setFileName('Appointment.pdf'); // set name of PDF
        efa.setBody(AppointmentUtils.getNotificationPDF(item.id)); //attach the PDF

        Messaging.EmailFileAttachment vcal = new Messaging.EmailFileAttachment();

        email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa, vcal});
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});  

Note this line: vcal.setContentType(mime);

I tried the following values for mime:






In all of these cases the calendar object showed up as an attachement rather than having the email itself be a calendar invitation.


There must be a bug in this feature in Winter '10, because nobody seems to know how to make it work so that you can send an invitation out that can be accepted seemlessly in calendar/email applications like Outlook and Gmail/Google Calendar.  We'ev attempted to escalated it within Salesforce to no avail.  Similar discussion threads exist as well:


If anyone has any helpful information, please provide it!




There has been no solution found to this yet. I am still waiting for the force developers to tell us how they did this. It would be great if they did since this is a major need of ours.


Other people have expressed similar sentiments: