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

#   Remove vendor address from email

##

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

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 5 months ago [\#242296](#242296) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242296 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")* was created by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")*

-- HikaMarket version -- : 2.3.5

Hi,

I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order_status_notification) I'm able to add a custom email address like below: Code:

if($data-&gt;order-&gt;order_status == 'shipped'){ $this-&gt;mailer-&gt;addBCC('email@address.com'); }

But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to email@address.com. Can I solve it somehow?

Thanks for your help in advance!

Regards,
PePe

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg0OTU0LXJlbW92ZS12ZW5kb3ItYWRkcmVzcy1mcm9tLWVtYWlsP3RtcGw9bWFya2Rvd24=) 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 5 months ago [\#242298](#242298) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242298 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")*

Hi,

The vendor order notification in HikaMarket is send to the vendor email (and his notified users).
Even if you can access to the mailer in the "preload" part of the email, the "dest email" is set after that in another function.
Which mean that you cannot replace the destination email unless you're doing the job just before the HikaShop job.

So if you want to override that, you'll need to use a plugin to catch (and modify) the email before it is sent by HikaShop.
[ www.hikashop.com/support/documentation/6...tml#onBeforeMailSend](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#onBeforeMailSend)

Regards,

PS : Please note that HikaMarket 2.3.5 does not exists.

---

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

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

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

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

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 5 months ago -  10 years 5 months ago [\#242389](#242389) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242389 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")*

Thanks for the advice Jerome.

I've created a hikashop plugin, installed and activated it with the following content, but with no luck: Code:

function onBeforeMailSend(&amp;$mail,&amp;$mailer){ $app =JFactory::getApplication(); $orderid = $app-&gt;getUserState('com_hikashop.order_id'); $orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;loadFullOrder($orderid); if($order-&gt;order_status == 'shipped'){ unset($mail-&gt;dst_email); } }

Any ideas what am I failed on?

Last edit: 10 years 5 months ago by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg0OTU0LXJlbW92ZS12ZW5kb3ItYWRkcmVzcy1mcm9tLWVtYWlsP3RtcGw9bWFya2Rvd24=) 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 5 months ago [\#242394](#242394) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242394 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")*

Hi,

Please note that the "$mail" object contains a lot of useful information ; like the mail name which is currently send and also his data (like the "order" when it's an order notification).
And your goal is to replace the destination email with another element.
If you want to refuse the expedition of an email the best would be to use the trigger "onBeforeMailPrepare" which have a "$do" parameter to cancel the mail.

You can see an example of mail handling in HikaMarket ; in the class "mail" you will see the function "beforeMailPrepare" which call different sub functions depending the mail name ; like "processContactMail" to change the destination email to the vendor while the contact request is regarding a vendor product.

Regards,

---

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

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

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

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

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 5 months ago -  10 years 5 months ago [\#242542](#242542) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242542 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")*

Hi Jerome!

Thanks, it seems the problem was that the order status was not loaded correctly. Also I added a BCC address to the dst_email, I modified to code this way, and it seems working ok:
Code:

function onBeforeMailPrepare(&amp;$mail,&amp;$mailer,&amp;$do){ if($mail-&gt;data-&gt;order-&gt;order_status == 'shipped'){ $mail-&gt;dst_email = 'email@address.com'; } }

Thanks for your help again!

Last edit: 10 years 5 months ago by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg0OTU0LXJlbW92ZS12ZW5kb3ItYWRkcmVzcy1mcm9tLWVtYWlsP3RtcGw9bWFya2Rvd24=) 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 5 months ago [\#242554](#242554) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242554 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")*

Hi,

Please do not use that code in your website ; You can potentially affect every emails which have an "order" data ; not only the HikaMarket email but also the HikaShop one.
You will find the right tips in my previous message and information where you can see some code to base your code on.

Regards,

---

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

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

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

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

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 5 months ago [\#242693](#242693) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242693 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")*

Oooh... jeeez... you're right.

I was playing all day to somehow fix that problem, this looks ok now, as any other ideas I had was not working: Code:

function onBeforeMailPrepare(&amp;$mail,&amp;$mailer,&amp;$do){ if((($mail-&gt;data-&gt;order-&gt;order_status == 'shipped') &#124;&#124; ($mail-&gt;data-&gt;order-&gt;order_status == 'confirmed'))){ $vendorClass = hikamarket::get('class.vendor'); $vendor = $vendorClass-&gt;get($mail-&gt;data-&gt;order-&gt;koltseghely); //koltseghely field was an already created field for vendor_id if ($vendor-&gt;vendor_email == $mail-&gt;dst_email){ $mail-&gt;dst_email = 'address@email.com'; } } }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg0OTU0LXJlbW92ZS12ZW5kb3ItYWRkcmVzcy1mcm9tLWVtYWlsP3RtcGw9bWFya2Rvd24=) 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 5 months ago [\#242696](#242696) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242696 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")*

Hi,

I have the impression that my tips are not read.

> Please note that the "$mail" object contains a lot of useful information ; **like the mail name which is currently send**

And I also told you to read the HikaMarket code in order to have a working base.

It will be the only submission of code in that thread ; please understand that custom development are not part of the support we are providing with our components. Code:

public function onBeforeMailPrepare(&amp;$mail, &amp;$mailer, &amp;$do) { $mail_name = $mail-&gt;mail_name; if(isset($mail-&gt;hikamarket) &amp;&amp; !empty($mail-&gt;hikamarket)) $mail_name = 'market.' . $mail_name; if($mail_name != 'market.order_status_notification' &#124;&#124; empty($mail-&gt;data-&gt;order_vendor_id)) return; $mail-&gt;dst_email = 'address@email.com'; $mail-&gt;dst_name = 'destination name"; }

Regards,

---

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

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

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

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

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 5 months ago [\#242743](#242743) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Remove vendor address from email](/forum/23-market-how-to/884954-remove-vendor-address-from-email#242743 "-- HikaMarket version -- : 2.3.5  Hi,  I've a really specialized problem and I would be really glad for a small help code snippet Jerome. In email (market.order&#95;status&#95;notification) I'm able to add a custom email address like below:  But I have to solve somehow to send status notification email in shipped status just to that specified custom email address. Neither for vendor, nor for customer, just to Can I solve it somehow?  Thanks for your help in advance!  Regards, PePe")*

Jerome, understood, I really appreciate your patience and help!
I've tried a lot ways you referenced in your earlier posts, but with no luck, so I had to try something that worked with my noob PHP skills.

Thank you again!

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

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