+ Start a Discussion
Peter CowenPeter Cowen 

javascript to save as ics

I have started looking into a way of creating a save to calendar link on a html email template as we find attempting to convert a HTML email template to a visualforce email template. 

I have got the link to appear on the email but I cannot get it to save as a ics file to see if it has worked. The script is below
<script> 
var cal = ics(); 
cal.addEvent('{!Service_Request__c.Name}', '{!Service_Request__c.Change_Details__c}', 'None', '{!Service_Request__c.Expected_Start__c}', '{!Service_Request__c.Expected_Completion_Date__c}'

</script>
<a href="javascript:addToOutlook()">Demo</a>

Is there anything I am missing? 
Saravanan @CreationSaravanan @Creation

Hi Peter,

You can refer this site.

https://douglascayers.com/2015/01/09/salesforce-send-calendar-invites-in-visualforce-email-templates/

Thanks,