Exemplo n.º 1
0
        private string CancelInvite(IStepInput input)
        {
            var CancelAttendees = (InviteAttendeesInput)input;
            var invite          = InviteInput.FromDict(this.Data);

            if (!IsCallRepeated(invite))
            {
                EnsureCallIsNotRepeated(invite);
            }
            else
            {
                return("<response>Invite cancelled already</response>");
            }

            //This is how we ensure we dont contact the same people over the same message again
            //Think duplicate calls to the API
            if (DataSerializer.DeserializeData(WorkflowEngine.GetDataKey("multi_invite", CancelAttendees.UniqueCallId)) != null)
            {
                return("<response>Contacts have been notified already</response>");
            }
            else
            {
                DataSerializer.SerializeData(WorkflowEngine.GetDataKey("multi_invite", CancelAttendees.UniqueCallId), new DataStorage());
            }

            foreach (var contact in CancelAttendees.Attendees)
            {
                CancelAttendee(invite, contact);
            }

            return("<response>Event cancelled succesfully</response>");
        }