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

#   Affiliate Mail

##

- **[manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")**
- [![manjeshmohan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile") Topic Author
- [ Offline](/forum/user/9480-manjeshmohan)

Less More

- Posts: 83
- Thank you received: 1
-
-
-

13 years 11 months ago [\#76331](#76331) by [manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")  *[Affiliate Mail](/forum/4-how-to/75770-affiliate-mail#76331 "Hi,  How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?  Thanks &amp; Regards, Manjesh.")* was created by *[manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")*

Hi,

How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?

Thanks &amp; Regards,
Manjesh.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc1NzcwLWFmZmlsaWF0ZS1tYWlsP3RtcGw9bWFya2Rvd24=) 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: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 11 months ago [\#76553](#76553) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Affiliate Mail](/forum/4-how-to/75770-affiliate-mail#76553 "Hi,  How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?  Thanks &amp; Regards, Manjesh.")*

Hi,

This feature is not implemented in HikaShop but it could be implemented using a custom plugin or by modifying the current affiliate plugin.
HikaShop have a lot of triggers and the trigger "onAfterOrderUpdate" is called when an order is update.
You can create a plugin which would receive this trigger and which would send an email to the affiliate partner if the order is confirmed.
The first parameter of the function is the order object which would contains a lot of useful information.
You can retrieve the user_id of the order, get the affiliate (if there), retrieve affiliate information and send him an email.

Regards,

---

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

The following user(s) said Thank You: [manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")

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

- **[manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")**
- [![manjeshmohan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile") Topic Author
- [ Offline](/forum/user/9480-manjeshmohan)

Less More

- Posts: 83
- Thank you received: 1
-
-
-

13 years 11 months ago [\#77704](#77704) by [manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")  Replied by *[manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")* on topic *[Affiliate Mail](/forum/4-how-to/75770-affiliate-mail#77704 "Hi,  How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?  Thanks &amp; Regards, Manjesh.")*

Is this the path and file of the affiliate plugin where we need to change? Do we need to change in any other files?

\components\com_hikashop\controllers\affiliate.php

Thanks &amp; Regards,
Manjesh.

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

- **[manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")**
- [![manjeshmohan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile") Topic Author
- [ Offline](/forum/user/9480-manjeshmohan)

Less More

- Posts: 83
- Thank you received: 1
-
-
-

13 years 11 months ago [\#77730](#77730) by [manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")  Replied by *[manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")* on topic *[Affiliate Mail](/forum/4-how-to/75770-affiliate-mail#77730 "Hi,  How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?  Thanks &amp; Regards, Manjesh.")*

It would be very helpful for me if could you please get me some sample code for testing the same? Let it be a simple one to check how the mail is send and received at the recipient's end.

I've tried so many ways but could not get the mail.

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc1NzcwLWFmZmlsaWF0ZS1tYWlsP3RtcGw9bWFya2Rvd24=) 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: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 11 months ago [\#77819](#77819) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Affiliate Mail](/forum/4-how-to/75770-affiliate-mail#77819 "Hi,  How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?  Thanks &amp; Regards, Manjesh.")*

Hi,

The affiliate system is a plugin so you can find it in the plugin folder : /plugins/system/hikashopaffiliate/

Regards,

---

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

The following user(s) said Thank You: [manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")

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

- **[manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")**
- [![manjeshmohan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile") Topic Author
- [ Offline](/forum/user/9480-manjeshmohan)

Less More

- Posts: 83
- Thank you received: 1
-
-
-

13 years 11 months ago [\#78154](#78154) by [manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")  Replied by *[manjeshmohan](/forum/user/9480-manjeshmohan "View manjeshmohan's Profile")* on topic *[Affiliate Mail](/forum/4-how-to/75770-affiliate-mail#78154 "Hi,  How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?  Thanks &amp; Regards, Manjesh.")*

Thanks for mentioning the path of the affiliate plugin code.
I've tried to test by adding the OnAfterOrderUpdate function and setting the true for sending the mail but I'm not getting any mail. I've checked the documentation and tried so many experiemtns also but no result was found.
Could you please show some sample working model of this function so as to test the sending of the mail?

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 11 months ago [\#78192](#78192) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Affiliate Mail](/forum/4-how-to/75770-affiliate-mail#78192 "Hi,  How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?  Thanks &amp; Regards, Manjesh.")*

Hi,
Code:

$mailClass = hikashop_get('class.mail'); $mail = new stdClass(); $mail-&gt;content = "content"; $mail-&gt;subject = $subject; $mail-&gt;from_email = $config-&gt;get('from_email'); $mail-&gt;from_name = $config-&gt;get('from_name'); $mail-&gt;reply_email = $element-&gt;email; $mail-&gt;dst_email = 'email1, email2; $status = $mailClass-&gt;sendMail($mail);

Or you can find a demonstration in the file: "components/com_hikashop/controllers/product.php"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc1NzcwLWFmZmlsaWF0ZS1tYWlsP3RtcGw9bWFya2Rvd24=) 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?

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

Time to create page: 0.262 seconds

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

[](#top)
