var customerReminderInfos = new List<CustomerReminderInfo>();
var _from = DateTime.Now.AddMinutes((int)conditionMetDateLaterThan.TotalMinutes * -1);
var _to = DateTime.Now.AddMinutes((int)conditionMetDataEarlierThan.TotalMinutes * -1);
var query = from sci in _sciRepository.Table
where sci.UpdatedOnUtc >= _from
&& sci.UpdatedOnUtc <= _to
&& sci.ShoppingCartTypeId == 1
&& sci.StoreId == storeId
select sci;
var cartItems = query.ToList();
var customers = cartItems.Select(p => p.Customer).Distinct().ToList();
foreach (var customer in customers)
{
if (!customer.IsRegistered())
continue;
var tokens = GetTokens(customer, store);
var customerReminderInfo = new CustomerReminderInfo()
{
Customer = customer,
ReminderMessageId = customer.Id,
RuleConditionMetDate = DateTime.Now,
Tokens = tokens,
StoreId = storeId
};
customerReminderInfos.Add(customerReminderInfo);
}
return customerReminderInfos;
Hi Justin,