Inhalte aufrufen

Profilbild

Create new scheduled task

scheduled task

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
2 Antworten zu diesem Thema

#1 raetser

raetser

    Benutzer

  • Members
  • 27 Beiträge

Geschrieben: 28 February 2016 - 10:57

Hello guys,

I would like to add a new scheduled task that runs once a day let's say, to send an email to customers to ask them to fill in a product review.

I am not too familiar with the inner workings of Smartstore, I did find the scheduled tasks in the database and the code in the project, but how could I implement this?

How do I get the customers that had their order shipped more then 10 days ago and did not yet receive my review reminder email yet?

 

Do you have some sample code? I think it would be a nice addition to have this functionality...

 

Thank you!

 

Erwin



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 29 February 2016 - 10:42

You could write a plugin that implements ITask:
- The constructor receives an instance of IOrderService through Autofac
- Implementation of ITask.Execute calls IOrderService.SearchOrders with endTime = 10 days ago and shippingStatusIds = ShippingStatus.Shipped and orderStatusId = OrderStatus.Complete
- Information whether the reminder has been sent could be stored as a generic attribute through IGenericAttributeService.SaveAttribute. Advantage, the merchant can see that information on the order edit page.

Marcus Gesing

Smartstore AG


#3 raetser

raetser

    Benutzer

  • Members
  • 27 Beiträge

Geschrieben: 29 February 2016 - 20:35

Hello Marcus,

 

I will give it a shot, will probably get back to you if I cannot get it working :-)

 

Thanks!

Erwin