/// <summary> /// Checks if the given <paramref name="listName"/> has the recipient <paramref name="recipientIdentity"/> /// </summary> /// <param name="listName"></param> /// <param name="recipientIdentity"></param> /// <param name="cancellationToken"></param> /// <returns>Boolean indicating if the recipient is or not on the list</returns> public async Task <bool> HasRecipientAsync(string listName, Identity recipientIdentity, CancellationToken cancellationToken = default(CancellationToken)) { var broadcastExtension = new BroadcastExtension(_sender); var hasRecipient = await broadcastExtension.HasRecipientAsync(listName, recipientIdentity, cancellationToken); return(hasRecipient); }
/// <summary> /// Returns a given number <paramref name="take"/> (with a <paramref name="skip"/> offset) of recipients /// </summary> /// <param name="skip"></param> /// <param name="take"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task <DocumentCollection> GetRecipientsAsynGetAllDistributionListsAsync(int skip = 0, int take = 100, CancellationToken cancellationToken = default(CancellationToken)) { var broadcastExtension = new BroadcastExtension(_sender); var allDistributionListsRecipients = await broadcastExtension.GetRecipientsAsynGetAllDistributionListsAsync(skip, take, cancellationToken); return(allDistributionListsRecipients); }
/// <summary> /// Returns a list of recipients for the list with the name <paramref name="listName"/> /// </summary> /// <param name="listName"></param> /// <param name="skip">Recipients to skip from the start</param> /// <param name="take">Amount of recipients to get</param> /// <param name="cancellationToken"></param> /// <returns>DocumentCollection with the items being the recovered recipients</returns> public async Task <DocumentCollection> GetRecipientsAsync(string listName, int skip = 0, int take = 100, CancellationToken cancellationToken = default(CancellationToken)) { var broadcastExtension = new BroadcastExtension(_sender); var recipients = await broadcastExtension.GetRecipientsAsync(listName, skip, take, cancellationToken); return(recipients); }
/// <summary> /// Gets the list's identity based on the <paramref name="listName"/> /// </summary> /// <param name="listName"></param> /// <returns></returns> public Identity GetListIdentity(string listName) { var broadcastExtension = new BroadcastExtension(_sender); var listIdentity = broadcastExtension.GetListIdentity(listName); return(listIdentity); }
public static IChatbotFlowService GetFlowService() { var sender = GetSender(); var owlFilter = new OWLFilter(GetClient()); var carouselBuilder = new CarouselBuilder(owlFilter); var quickReplyBuilder = new QuickReplyBuilder(); var broadcast = new BroadcastExtension(sender); var bucket = new BucketExtension(sender); var contextManager = new ContextManager(bucket); return(new ChatbotFlowService ( carouselBuilder, quickReplyBuilder, broadcast, contextManager, owlFilter, sender )); }
/// <summary> /// Adds a recipient to a broadcast list based on the recipient's identity and the list's name /// </summary> /// <param name="listName"></param> /// <param name="recipientIdentity"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task AddRecipientAsync(string listName, Identity recipientIdentity, CancellationToken cancellationToken = default(CancellationToken)) { var broadcastExtension = new BroadcastExtension(_sender); await broadcastExtension.AddRecipientAsync(listName, recipientIdentity, cancellationToken); }
/// <summary> /// Sends a message to the given broadcast list /// </summary> /// <param name="listName"></param> /// <param name="content">Message to be sent</param> /// <param name="id"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task SendMessageAsync(string listName, Document content, string id = null, CancellationToken cancellationToken = default(CancellationToken)) { var broadcastExtension = new BroadcastExtension(_sender); await broadcastExtension.SendMessageAsync(listName, content, id, cancellationToken); }
/// <summary> /// Deletes a given distribution list /// </summary> /// <param name="listName"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task DeleteDistributionListAsync(string listName, CancellationToken cancellationToken = default(CancellationToken)) { var broadcastExtension = new BroadcastExtension(_sender); await broadcastExtension.DeleteDistributionListAsync(listName, cancellationToken); }