How to cancel an calendar event using ics files? - outlook

One of our requirements is to create iCalendar files (.ics) and send them each in emails as an attachment. We are using DDay.Ical.dll to create ics files as under:
// Create a new iCalendar
iCalendar iCal = new iCalendar();
// Create the event, and add it to the iCalendar
Event evt = iCal.Create<Event>();
// Set information about the event
evt.Start = new iCalDateTime(SomeStartTime);
evt.End = new iCalDateTime(SomeEndTime);
evt.Location = "At so and so place";
evt.Description = "Some Description";
evt.Summary = "About Some Subject";
iCal.Method = "PUBLISH";
// Serialize (save) the iCalendar
iCalendarSerializer serializer = new iCalendarSerializer();
serializer.Serialize(iCal, #"iCalendar.ics");
Complete process is:
User1 create an iCal file for specific date and time and send it to User2.
User2 will open the ics file and accept the invitation. An appointment item will be created in User2's LOCAL outlook.
Now, Suppose, because of any reason if appointment is cancelled, then User1 HAS to create an ics file and send it to User2, so that User2 can cancel his event from the local outlook.
How to create such ics file?

File gets created in the same way as the original ics file. The event status will be different. UID will identify the event and sequence number will indicate priority of update, and then the event details will be noted (changes or cancellations)
If you want to change/cancel an event after sending out an invitation, you need to identify the event/appointment by its UID, and allocate a bigger SEQUENCE number than the original ics event.
UID (unique identifier) : https://www.rfc-editor.org/rfc/rfc5545#page-117
Sequence: https://www.rfc-editor.org/rfc/rfc5545#page-138
and set the event status
/ "CANCELLED" ;Indicates event was cancelled.
Status: https://www.rfc-editor.org/rfc/rfc5545#page-92
oh - and method
If you need to send in a cancellation for an event the UID should be same as the original event and the component properties should be set to cancel Ex.
METHOD:CANCEL
STATUS:CANCELLED
Of course this will only 'cancel' the event if the recipient then actually clicks to load/subscribe it into the same calendar app as the first time.
For applications that have 'subscribed' the the remote ics - when they next do an 'update' check the update should be processed and overwrite the original event.

Old thread, but just wanted to give my input.
Also had the problem with outlook showing "not supported format" on a cancel ics. Tried to change METHOD to REQUEST, sort of solved the problem in Outlook, but Gmail and others was not handling it well, looked like an invite, with yes/no/maybe buttons.
After much (MUCH) looking around for solve the problem, I finally realized that the problem was not within the ics file, but how the file was attached to the email. I added it with method:REQUEST. After changing that to method:CANCEL it works well in all clients.
contype = new System.Net.Mime.ContentType("text/calendar");
//contype.Parameters.Add("method", "REQUEST");
contype.Parameters.Add("method", "CANCEL");
contype.Parameters.Add("charSet", "utf-8");
contype.Parameters.Add("name", "invite.ics");

Edit all the events in the ics file using any text file editor (eg. Visual Studio Code) and import modified the calenar again:

I had the issue when i sent mail containing ics file for delete event but in outlook it show me not supported format
then i figured out somewhere on net and i found that i just need to change
METHOD: CANCEL to METHOD: REQUEST
when i import this in outlook

Related

Telegram add and retrieve metadata from message

Hi I'm looking for a way to store user session/metadata with the least amount of latency and that will not cost me an arm and a leg.
Brief problem description.
I have a bot that helps users download files from Google Drive.
It uses a Webhook of an AWS lambda function.
Users are provided with clickable filenames, e.g.
/File.pdf
Once they click on it, it needs to be downloaded and sent to the user.
The problem is I need a way of knowing what file the user chose without having to use a database or iterating through all my files by name.
E.g. Is there a way of adding metadata to the clickable message? Such that I can add that metadata to the clickable and if a user clicks /File.pdf, I'll be able to extract the metadata.
You can send InlineKeyboardButton like in this example and set in callback_data whatever you need. When user clicks on that button - your bot will receive that data in update:
button_list = [
InlineKeyboardButton("File1.pdf", callback_data="https://drive.google.com/invoice.pdf"),
InlineKeyboardButton("File2.pdf", callback_data="https://drive.google.com/presentation.pdf"),
InlineKeyboardButton("File3.pdf", callback_data="https://drive.google.com/report.pdf")
]
reply_markup = InlineKeyboardMarkup(button_list)
bot.send_message(chat_id=chat_id, "Files list:", reply_markup=reply_markup)
# in update handler:
def some_update_handler(update, context):
url = update.callback_query.data
# ...
# further processing
This can be also useful in any other case when Telegram bot user should see some nice message, but shouldn't see some internal value sent to Telegram bot.

Modify/change Outlook Calendar event with AppleScript

I have a script that creates an Outlook calendar event from content in an email (also from Outlook). The email contains the name of the event, date/time, and a single attendee's information.
The event is first created with the one attendee that was specified from the email.
I will receive more emails that indicate additional attendees (one per email) and which event the new attendee should be added to.
Right now my script is able to create a calendar event(with location, subject, start/end time, content, and reminder time) and add one required attendee to the event, then send the event to the attendee.
I need to get access to existing events with the same subject and add more attendees to the event.
Right now I'm trying to achieve this with this code:
tell application "Microsoft Outlook"
<...>
set textContent to paragraphs of msgContent
--Check for existing calendar event
set prevEvent to "false"
try
set existingEvent to get (calendar event of calendar whose its subject is item 9 of textContent)
tell existingEvent
make new required attendee at end of attendees with properties {email address:{name:attendeeName, address:attendeeEmail}}
end tell
open existingEvent --This is done so I can make sure it has the info I need. The I'm done it will be changed to "send meeting..."
set prevEvent to "true"
on error
log "Event does not exsist"
end try
if prevEvent = "true" then exit repeat
<...>
--Code to create a new event
set msgToSend to make new calendar event with properties {location:msgLocation, subject:msgSubject, start time:meetingDateTime, end time:endTime, content:msgNewContent, has reminder:true, reminder time:30}
<...>
end tell
I'm not getting an error but my code just exits the try/error so I think my "set existingEvent to" is wrong.
I was able to add an attendee with this code
--Create/add attendee for calendar message invite
make new required attendee at msgToSend with properties {email address:{name:"First Last", address:"first.last#email.com"}}
Where msgToSend is a new calendar event that will be sent out. This event is created by
--Create calendar message invite
set msgToSend to make new calendar event with properties {location:msgLocation, subject:msgSubject, start time:meetingDateTime, end time:endTime, content:msgNewContent, has reminder:true, reminder time:30}
I was not able to determine how to check for and modify existing events using AppleScript. I switched to using Microsoft Flow to achieve my task.

Glympse API - PreSet a Nick Name

I want to preset the nickname of the sender which will be shown at the receiver's end while sending the Glympse Ticket.
Issue :- When first time the sender is sending a Glympse it asks for Saving and Sending with a nick name, rather I have already set a nick name with the code detailed below.
GGlympseLite glympse = GlympseLiteWrapper.instance().getGlympse();
glympse.setNickname(DCCApplication.session.getName());
While the above code works fine from the second time onwards, but it asks for the Nick Name when the user is sending the Glympse for First Time, and it asks for the nickname everytime till the User has entered once in that popup.
Please let me know why is it so?
Thanks
Your code for setting the nickname is perfect, but there is one very recent change in our SDK that is causing it to not set properly. The Glympse platform must be synchronized with the server before calling setNickname(). This change is mentioned under 2.6.54 in our change log:
https://developer.glympse.com/Content/client/full/android/guides/Glympse_Api_Android_Changelog.html
Implement GListenerLite as specified here:
Glympse API - Handle Send Ticket Operation
And listen for the LC.EVENT_SYNCED event.
#Override public void eventsOccurred(GGlympseLite glympse, int event, Object param1, Object param2)
{
if (0 != (event & LC.EVENT_SYNCED))
{
Log.d("", "Synced with server");
GlympseLiteWrapper.instance().getGlympse().setNickname(DCCApplication.session.getName());
}
}

Cancel appointment and associated resources in Outlook when created using EWS Managed API

I am using the EWS Managed API to create appoitments on Exchange 2010.
Appointment appointment = new Appointment(exchangeService);
appointment.Subject = "Sample meeting";
appointment.Body = "Sample meeting body";
appointment.Start = bookingInfo.from;
appointment.End = bookingInfo.from.AddMinutes(bookingInfo.duration);
appointment.Location = meetingRoom.displayName;
appointment.Resources.Add(<my_room_mail>);
// Send the meeting request to all attendees and save a copy in the Sent Items folder.
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
This piece of code create effectively an appoitment in my Outlook but the Meeting Room included as a resource is marked as a "tentative" (not really accepted). So when I want to delete the meeting, the meeting room stay booked (busy/tentative) for the slot and it is impossible to delete the tentative.
If I delete the appoitment from the EWS code (using the appoitment ID), it works as expected, the room is effectively free.
Appointment appointment = Appointment.Bind(exchangeService, new ItemId(itemId));
appointment.Delete(DeleteMode.MoveToDeletedItems);
Do you have any idea of what is the problem ? Outlook right ? Bad appoitment creation or resource booking ?
Ok, I understand that Direct Booking is not compatible with EWS/OWA/Mobile solutions (and also with Outlook 2010/2013 without register tweak).
Direct Booking and Resource Booking Attendant (Auto Accept feature) are conflicting technologies, and if enabled together, unexpected behavior in calendar processing and item consistency can occur.
Check this for more details :
http://msexchangeanswers.blogspot.fr/2009/08/outlook-direct-booking-vs-auto-accept_17.html
http://exchangeserverinfo.net/2013/05/remove-auto-accept-from-outlook-for-all-room-mailbox/
The resource room needs to auto-accept the invitation, so it loses its tentative status. Then when you delete the appointment from your calendar, it should automatically send cancellation to the room. There is a setting on the delete to do this, and I forget off the top of my head if it's the default or not, but I think the initial issue is why the room is not configured to accept or reject the invite sent.

How to create a "log file" message in the Deleted Items folder from an Outlook Addin

I have an addin that synchronized the contacts folder with an outside source. The Sync happens daily (or manually on demand) and takes a while. Users have asked for the addin to provide information about the sync so that they know it completed successfully, etc.
Since the Outlook API doesn't provide a way to add information to the status bar (i.e. details about the sync as it is happening), I would like to create a log file automatically each sync (and stick it in the Deleted Items folder so that it is out of the way).
When I tried to create a message and .Move() it to the deleted items folder, it appeared there, but without a Received time and so was sorted to the end of the list and hard to find. Also, it looks to the user like an unsent message (a draft).
Is there a way to create a message and have the Received time be set to approx the time the message was created (the property is read-only)?
NameSpace mapi = _outlook.GetNamespace("MAPI");
MAPIFolder deletedItems = mapi.GetDefaultFolder(OlDefaultFolders.olFolderDeletedItems);
MailItem message = (MailItem)_outlook.CreateItem(OlItemType.olMailItem);
message.Subject = "Contact Sync Errors";
message.BodyFormat = OlBodyFormat.olFormatPlain;
message.Body = "This is my log message";
message.Move(deletedItems);
This is what I ended up doing. I used a Post instead of a Message because that worked better.
PostItem message = (PostItem)this.Application.CreateItem(OlItemType.olPostItem);
message.Subject = "Contact Sync Log";
message.BodyFormat = OlBodyFormat.olFormatPlain;
message.Body = "My Message Here";
message.Post();
message.Delete();
The Post is created, filled out with details, "Posted" so that it has valid timestamps, and then immediately deleted (because I wanted it in the Deleted Items folder). Had I not deleted it, it would have been in the Inbox folder.

Resources