adamgibbons / ics

iCalendar (ics) file generator for node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Which parameter is being used to update existing event in calendar?

Jaysojitra13 opened this issue · comments

Thank you so much for introducing this module. It is really helpful.

I have the below scenario, please tell me how to handle that:

  • When the user booked an appointment at that time I'm creating one ics file with the below parameters. and we don't want end-user to confirm or reject the event. It will be 'accepted' by default. When a user clicks on "add to calendar" in Gmail then it will be created in the calendar.

{ start: [2022, 9, 1, 15, 0], // service time duration: { hours: 0, minutes: 30 }, // time duration title: Appointment created for service with cutter, // Sevice name description: 'calenderObj.description', // phone number location: address, // store address status: 'CONFIRMED', organizer: { name: 'Admin', email: process.env.SENDER_ADDRESS }, attendees: [ { name: jay, email: Testuser@yopmail.com, partstat: 'ACCEPTED', role: 'REQ-PARTICIPANT' } ], uid: "123" }

  • Now, when the service gets updated/edited to another time then we need to send another email with the latest ics file will be triggered. And when the user clicks on "Add to Calendar" from Gmail then the new event is created in the calendar.

NOTE:: In both files, "uid" is the same.

Expected Result: the previous event should get updated.

Thank you in advance.

@adamgibbons I have one more question :

  • I add a description key in the event object and it's previewed in google calendar on the web. But in mobile application description is not previewed. Every time it is empty.

Can you please help me with this?

commented

Check that you increment the sequence. See example on package first page.

sequence | For sending an update for an event (with the same uid), defines the revision sequence number. [1]
[1]: https://www.npmjs.com/package/ics

@getarun Thank you for the answer. I have also tried this by adding sequence parameters 0 (for the first time) and 1 (the second time). But it didn't work