Skip to content

Commit

Permalink
Add method for deleting calendar items with meeting cancellation (#277)
Browse files Browse the repository at this point in the history
The deletion of calendar items requires that is defined who to send
meeting cancellations to.  This adds a method on CalenderItem that
allows the cancellation type to be set or falls back to a default.
See also:
https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem

It is similar to a method that was present in Viewpoint ≤ 0.1.27.
  • Loading branch information
paulvt authored Jul 8, 2024
1 parent 187b853 commit fb8edab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/ews/types/calendar_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ class CalendarItem
}
CALENDAR_ITEM_KEY_ALIAS = {}

# Delete this calendar item
# @param deltype [Symbol] The delete type; must be :hard, :soft, or :recycle.
# By default EWS will do a hard delete of this calendar item. See the=
# MSDN docs for more info: http://msdn.microsoft.com/en-us/library/aa562961.aspx
# @param cancel_type [String] 'SendToNone'/'SendOnlyToAll'/'SendToAllAndSaveCopy'
# Default is 'SendOnlyToAll'
# @return [Boolean] Whether or not the calendar item was deleted
def delete!(deltype = :hard, cancel_type = 'SendOnlyToAll', opts = {})
opts = opts.merge(:send_meeting_cancellations => cancel_type)
super(deltype, opts)
end

# Updates the specified item attributes
#
# Uses `SetItemField` if value is present and `DeleteItemField` if value is nil
Expand Down

0 comments on commit fb8edab

Please sign in to comment.