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>"); }
private string InviteAttendees(IStepInput input) { var inviteAttendees = (InviteAttendeesInput)input; if (!this.Data.ContainsKey("invite_unique_id")) { return("<response>The invite with id " + inviteAttendees.InviteId + " doesnt exists, please create the invite first</response>"); } if (!IsCallRepeated(inviteAttendees)) { EnsureCallIsNotRepeated(inviteAttendees); } else { return("<response>Contacts notified already</response>"); } var invite = InviteInput.FromDict(this.Data); foreach (var contact in inviteAttendees.Attendees) { InviteAttendee(invite, contact); } return("<response>Contacts notified succesfully</response>"); }
private string InviteCallReply(IStepInput input) { if (Data["invite_unique_id"] != null) { var invite = InviteInput.FromDict(this.Data); var contact = Contact.FromDict(this.Data); var message = "Hello {0}, You have been invited to {1} on {2}. Please press 1 if you want to come, 2 if not."; message = string.Format( message, contact.Name, invite.Title, invite.Start.ToString() ); XmlWriter.EnterNumber( message, new Dictionary <string, string>() { { "step", "callreply" }, { "type", "invite" } } ); } else { XmlWriter.SayMessage("You have not been invited to this event, hang up"); } return(XmlWriter.ToString()); }
private string InviteEmailReply(IStepInput input) { if (Data["invite_unique_id"] != null) { var invite = InviteInput.FromDict(this.Data); var contact = Contact.FromDict(this.Data); Bus.Send(new CreateEmailMessage() { Id = Guid.NewGuid().ToString(), Address = contact.Email, Sender = "*****@*****.**", Subject = "Thanks for your Reply", BodyTemplate = invite.ResponseEmailTemplate }); Bus.Send(GetApiCall("email", "yes")); if (invite.ResponseEmailTemplate != null && !string.IsNullOrEmpty(invite.ResponseEmailTemplate.RedirectUrl)) { var templateManager = new MemoryTemplateManager(); return(templateManager.Fill(invite.ResponseEmailTemplate.RedirectUrl, this.Data)); } else { return("<Response>Thank you for your response</Response>"); } } else { return("<Response>You havent been invited</Response>"); } }
private string InviteSmsReply(IStepInput input) { if (Data["invite_unique_id"] != null) { string message = (input["Body"].ToLower() == "yes") ? "I'm glad you coming!" : "Im so sorry to hear that you cannot come"; if (Data.ContainsKey("responded")) { message = "You already responded to the invitation"; } var phoneNumber = input["Phone"].NormalizePhone(); Bus.Send(new CreateSmsMessage() { PhoneNumber = phoneNumber, Message = message, Id = Guid.NewGuid().ToString() }); Bus.Send(GetApiCall("sms", input["Body"])); return("<response>Response To Confirmation sent succesfully</response>"); } else { return("<Response>You havent been invited</Response>"); } }
private void Awake() { _lobbyToggle = lobbyToggleProvider.value; _bankingToggle = bankingToggleProvider.value; _betStepper = betStepProvider.value; _autoBetToggle = autoBetToggleProvider.value; _soundToggle = soundToggleProvider.value; }
public virtual string Execute(string step, IStepInput input) { if (!Steps.ContainsKey(step)) { throw new Exception("There is no step defined for workflow: " + this.GetType().Name + " with name: " + step); } return(Steps[step].Execute(input)); }
private string InviteCallReplyResult(IStepInput input) { var message = string.Empty; message = input["Body"] == "1" ? "I'm glad you comming!" : "I'm dissapointed"; Bus.Send(GetApiCall("voice", (input["Body"] == "1")?"yes":"no")); XmlWriter.SayMessage(message); return(XmlWriter.ToString()); }
private string CreateInvite(IStepInput input) { var invite = input as InviteInput; var inviteId = invite.InviteId; if (!IsCallRepeated(invite)) { EnsureCallIsNotRepeated(invite); } else { return("<response>Invite sent already</response>"); } Trace.WriteLine("Starting to Send invite with Id: " + inviteId); this.Data.Update(invite.ToDict()); ShareToSocialNetworks(invite); return("<response>Invite sent succesfully</response>"); }
public IActionOutput Execute(IStepInput input) { throw new NotImplementedException(); }
public override string Execute(string step, IStepInput input) { return("<?xml version='1.0' encoding='UTF-8'?><Response><Hangup/></Response>"); }
private bool isStepEnabled(IStepInput control) { return(control.isVisible && control.isEnabled); }
public override string Execute(IStepInput input) { return(Twiml); }
public abstract string Execute(IStepInput input);
public abstract IActionOutput Execute(IStepInput input);
public string Execute(IStepInput input) { return(toExecute(input)); }