Question about creating daily/weekly e-mails

  • Posts: 62
  • Thank you received: 1
8 years 11 months ago #223431

-- HikaShop version -- : 2.6.0
-- HikaMarket version -- : 1.6.7
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.4
-- Browser(s) name and version -- : Chrome 47
-- Error-message(debug-mod must be tuned on) -- : None

Can you help me on my way with the following?
1. I would like to set up a cron job that sends a daily and/or weekly and/or monthly e-mail to all Vendors (Hikamarket) with all the products that have been ordered from those vendors. So no e-mails when an order is done, but just one e-mail a day with a complete list of ordered products of all orders combined.

2. I would like to set up a cron job that sends a weekly invoice from each vendor to the main vendor with all the products ordered in that week. But with the vendor pricing, invoicing the main Vendor.

I know how to make a plugin, but I am not sure how I can speak to it from a scheduled task (like cronjob) I need some pointers how to do that.
Also I would like it to use the main e-mailing features of Hikashop if possible.

Thank you in advance!

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 11 months ago #223494

Hi,

Each point will require a custom plugin and probably a custom email.
To generate such content, you need to perform SQL queries to extract that information and then, generate the emails for the different impacted vendors.
Depending the number of vendors in your store ; it might be useful to have a batch mode in the plugin because it could require some time to generate all emails if you have a lot of orders (and it could time out depending the server configuration).

Using a (custom) plugin you can use the HikaShop Cron triggers.
www.hikashop.com/support/support/documen...nHikashopCronTrigger
Most of cron plugins have parameters which allow them to know the last time they were called ; they can also store extra information for batch processing (like the last vendor processed).

Using a (custom) plugin you can also create new emails ; like HikaMarket (or HikaSerial) have his own emails which are also listed and can be override in the HikaShop backend.

onMailListing(&$files)
onBeforeMailPrepare(&$mail, &$mailer, &$do)
You can look in the HikaMarket integration plugin (and in the HikaMarket mail class) in order to know more about how using these two triggers.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 8 years 11 months ago by Jerome. Reason: fix tag

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.057 seconds
Powered by Kunena Forum