Search code examples
calendargmailicalendar

Not showing RSVP buttons in email - ical-generator


Not getting RSVP buttons in the email. I'm using "ical-generator" NPM to generate ics file.

This is code to generate ics file

let eventObj = {
    method: 'request',
    start: new Date(startTime),
    end: new Date(endTime),
    summary: "testing meeting",
    uid: uid,
    sequence: 0,
    description: description,
    organizer: {
        name: fullname,
        email: email
    },
    attendees:[
        {
            mailto : '[email protected]',
            email : '[email protected]',
            name : 'john',
            status : 'needs-action',
            rsvp : true,
            type : 'individual'
        }
    ],
    status: 'confirmed'
}
let cal = ical();
cal.domain(url).name('My ical invite');
cal.createEvent(eventObj);

my ics file will look like below

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//sebbo.net//ical-generator//EN
NAME:My ical invite
X-WR-CALNAME:My ical invite
BEGIN:VEVENT
UID:5f44e98484341386e4523ba1@dominname
SEQUENCE:0
DTSTAMP:20200825T103548Z
DTSTART:20200826T183000Z
DTEND:20200826T190000Z
SUMMARY:testing meeting
DESCRIPTION:meeting Description : testing
ORGANIZER;CN="peter":mailto:[email protected]
ATTENDEE;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;RSVP
 =TRUE;CN="john";[email protected]:MAILTO:[email protected]
STATUS:CONFIRMED
END:VEVENT
END:VCALENDAR

in my mail, I'm getting ics like below (I'm using gmail)

Here I'm not getting RSVP buttons and also in my ics file 'METHOD:REQUEST' is missing.

could you please help me out of this

thank you


Solution

  • I place 'method' in the wrong place

    it should be here

    let cal = ical()
    cal.method('REQUEST')
    cal.domain(url).name('My ical invite')
    

    Now I'm able to get RSVP button on email