[Skip to main content](#vessel-content)

#   Question about creating daily/weekly e-mails

##

- **[nuntius](/forum/user/29512-nuntius "View nuntius's Profile")**
- [![nuntius's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar29512.jpg)](/forum/user/29512-nuntius "View nuntius's Profile") Topic Author
- [ Offline](/forum/user/29512-nuntius)
- nuntius.nl

Less More

- Posts: 62
- Thank you received: 1
-
-
-
-

10 years 11 months ago [\#223431](#223431) by [nuntius](/forum/user/29512-nuntius "View nuntius's Profile")  *[Question about creating daily/weekly e-mails](/forum/23-market-how-to/880965-question-about-creating-daily-weekly-e-mails#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!")* was created by *[nuntius](/forum/user/29512-nuntius "View nuntius's Profile")*

-- 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODgwOTY1LXF1ZXN0aW9uLWFib3V0LWNyZWF0aW5nLWRhaWx5LXdlZWtseS1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 11 months ago -  10 years 11 months ago [\#223494](#223494) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about creating daily/weekly e-mails](/forum/23-market-how-to/880965-question-about-creating-daily-weekly-e-mails#223494 "-- 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!")*

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](https://www.hikashop.com/support/support/documentation/62-hikashop-developer-documentation.html#onHikashopCronTrigger)
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. Code:

onMailListing(&amp;$files) onBeforeMailPrepare(&amp;$mail, &amp;$mailer, &amp;$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 &amp; HikaSerial developer / HikaShop core dev team.

Last edit: 10 years 11 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: fix tag

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODgwOTY1LXF1ZXN0aW9uLWFib3V0LWNyZWF0aW5nLWRhaWx5LXdlZWtseS1lLW1haWxzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.059 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
