Table of Contents

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 Product

The product, required.

contextLanguageId string

The context language id, required.

contextAreaId int

The context area id, required.

unitId string

The unit id, required.

email string

The email address, optional.

Exceptions

ArgumentNullException

Thrown when product, contextLanguageId, contextAreaId or unitId is null or empty.

DeleteById(int)

Deletes notification by id.

public virtual bool DeleteById(int id)

Parameters

id int

The notification id.

Returns

bool

DeleteByProductKey(ProductKey)

Deletes notifications by a product key.

public virtual bool DeleteByProductKey(ProductKey productKey)

Parameters

productKey ProductKey

The product key containing product id, variant id and language id.

Returns

bool

Exceptions

ArgumentNullException

Thrown when productKey is null.

GetById(int)

Gets notification by the id.

public virtual ProductBackInStockNotification? GetById(int id)

Parameters

id int

The notification id.

Returns

ProductBackInStockNotification

GetNotificationsToSent(int)

Gets notification ready to sent.

public virtual IEnumerable<ProductBackInStockNotification> GetNotificationsToSent(int areaId)

Parameters

areaId int

The area id.

Returns

IEnumerable<ProductBackInStockNotification>

MoveProductBackInStockNotifications(IEnumerable<ProductBackInStockNotificationMoveSetting>)

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

product Product

The product.

unitId string

The unit id.

Returns

bool

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 DateTime

The 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 string

The email.

Exceptions

ArgumentNullException

Thrown when email is null or empty.

To top