Class ProductStockNotificationService
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Service for managing stock related product notifications.
public abstract class ProductStockNotificationService
- Inheritance
-
ProductStockNotificationService
- Inherited Members
Methods
CreateNotification(Product, string, int, string, string?)
Registers a new notification for the product and unit id with given email.
public virtual void CreateNotification(Product product, string contextLanguageId, int contextAreaId, string unitId, string? email)
Parameters
productProductThe product, required.
contextLanguageIdstringThe context language id, required.
contextAreaIdintThe context area id, required.
unitIdstringThe unit id, required.
emailstringThe email address, optional.
Exceptions
- ArgumentNullException
Thrown when
product,contextLanguageId,contextAreaIdorunitIdis null or empty.
DeleteById(int)
Deletes notification by id.
public virtual bool DeleteById(int id)
Parameters
idintThe notification id.
Returns
DeleteByProductKey(ProductKey)
Deletes notifications by a product key.
public virtual bool DeleteByProductKey(ProductKey productKey)
Parameters
productKeyProductKeyThe product key containing product id, variant id and language id.
Returns
Exceptions
- ArgumentNullException
Thrown when
productKeyis null.
GetById(int)
Gets notification by the id.
public virtual ProductBackInStockNotification? GetById(int id)
Parameters
idintThe notification id.
Returns
GetNotificationsToSent(int)
Gets notification ready to sent.
public virtual IEnumerable<ProductBackInStockNotification> GetNotificationsToSent(int areaId)
Parameters
areaIdintThe area id.
Returns
MoveProductBackInStockNotifications(IEnumerable<ProductBackInStockNotificationMoveSetting>)
Moves the specified ProductBackInStockNotificationMoveSettings.
public virtual void MoveProductBackInStockNotifications(IEnumerable<ProductBackInStockNotificationMoveSetting> moveSettings)
Parameters
moveSettingsIEnumerable<ProductBackInStockNotificationMoveSetting>
Exceptions
- ArgumentNullException
Thrown when
moveSettingsis null.
NotificationExists(Product, string?)
Checks whether notification exists by product and unit id.
public virtual bool NotificationExists(Product product, string? unitId)
Parameters
Returns
Exceptions
- ArgumentNullException
Thrown when
productis null.
SetMessageSent(IEnumerable<int>, DateTime)
Updates notifications with given ids with message sent status.
public virtual void SetMessageSent(IEnumerable<int> notificationIds, DateTime sentTime)
Parameters
notificationIdsIEnumerable<int>The notifications ids.
sentTimeDateTimeThe date for which the notifications were sent.
Exceptions
- ArgumentNullException
Thrown when
notificationIdsis null.
UnsubscribeNotifications(string)
Unsubscribes the email from notification.
public virtual void UnsubscribeNotifications(string email)
Parameters
emailstringThe email.
Exceptions
- ArgumentNullException
Thrown when
emailis null or empty.