Skip to content

Instantly share code, notes, and snippets.

@allenmichael
Last active October 22, 2015 19:00
Show Gist options
  • Save allenmichael/a07818f37e3d62dba6e0 to your computer and use it in GitHub Desktop.
Save allenmichael/a07818f37e3d62dba6e0 to your computer and use it in GitHub Desktop.
Get a Instock Notifications Collection and use LINQ to locate all notifications with a ProductCode matching what you specify and log the email address of the user owning that notification.
var instockResource = new Mozu.Api.Resources.Commerce.InStockNotificationSubscriptionResource(_apiContext);
var notifications = instockResource.GetInStockNotificationSubscriptionsAsync().Result;
var notificationsForProduct = notifications.Items.Where(x => x.ProductCode == "MS-BTL-002-1");
foreach(var notification in notificationsForProduct)
{
Console.WriteLine(notification.Email);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment