1

I had asked a question in another thread, and thought it might be helpful to create its own thread just in case it could be helpful to any other developers out there:

"I am trying to create a rule which follows up on existing orders of specific products. Each product has a different time interval for "follow up reminder", and my rule should trigger an email to be sent to a customer at a date which is calculated Order Creation Date + Follow Up Interval.

ie Order Creation + Value provided from Products in the order"

1 Answer 1

1

I wanted to share how I solved this problem: I created a rule which is dependent on an Order's Status being "Completed". This rule runs a custom PHP script which loads the Completed order Entity, retrieves each Line item and checks for its field called "Follow-up", which gives a time value in weeks

2
  • If that field isn't empty, it runs some code to convert the time into seconds, choose a date value based on the order date + the followup time, and inserts a row into a database for EACH line item which requires a followup service. In order to send out mail for each particular followup, I created a cronjob using crontab directly on the server hosting the project. This simply runs each morning, checks the database to see if any of the rows have a date which matches "today", and subsequently retrieves the relevant information and sends the customer the appropriate followup notice! Commented Jun 30, 2015 at 19:21
  • If anyone wants some more info, snippets, etc, I would be happy to share any part of this code! It is somewhat lengthy, so I didn't want to paste it all. Commented Jun 30, 2015 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.