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
product
ProductThe product, required.
contextLanguageId
stringThe context language id, required.
contextAreaId
intThe context area id, required.
unitId
stringThe unit id, required.
email
stringThe email address, optional.
Exceptions
- ArgumentNullException
Thrown when
product
,contextLanguageId
,contextAreaId
orunitId
is null or empty.
DeleteById(int)
Deletes notification by id.
public virtual bool DeleteById(int id)
Parameters
id
intThe notification id.
Returns
DeleteByProductKey(ProductKey)
Deletes notifications by a product key.
public virtual bool DeleteByProductKey(ProductKey productKey)
Parameters
productKey
ProductKeyThe product key containing product id, variant id and language id.
Returns
Exceptions
- ArgumentNullException
Thrown when
productKey
is null.
GetById(int)
Gets notification by the id.
public virtual ProductBackInStockNotification? GetById(int id)
Parameters
id
intThe notification id.
Returns
GetNotificationsToSent(int)
Gets notification ready to sent.
public virtual IEnumerable<ProductBackInStockNotification> GetNotificationsToSent(int areaId)
Parameters
areaId
intThe area id.
Returns
MoveProductBackInStockNotifications(IEnumerable<ProductBackInStockNotificationMoveSetting>)
Moves the specified ProductBackInStockNotificationMoveSettings.
public virtual void MoveProductBackInStockNotifications(IEnumerable<ProductBackInStockNotificationMoveSetting> moveSettings)
Parameters
moveSettings
IEnumerable<ProductBackInStockNotificationMoveSetting>
Exceptions
- ArgumentNullException
Thrown when
moveSettings
is 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
product
is null.
SetMessageSent(IEnumerable<int>, DateTime)
Updates notifications with given ids with message sent status.
public virtual void SetMessageSent(IEnumerable<int> notificationIds, DateTime sentTime)
Parameters
notificationIds
IEnumerable<int>The notifications ids.
sentTime
DateTimeThe date for which the notifications were sent.
Exceptions
- ArgumentNullException
Thrown when
notificationIds
is null.
UnsubscribeNotifications(string)
Unsubscribes the email from notification.
public virtual void UnsubscribeNotifications(string email)
Parameters
email
stringThe email.
Exceptions
- ArgumentNullException
Thrown when
email
is null or empty.