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

#   Using a invoice emailaddress

##

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

Less More

- Posts: 52
- Thank you received: 4
-
-

4 years 5 months ago [\#341910](#341910) by [Ginius](/forum/user/39267-ginius "View Ginius's Profile")  *[Using a invoice emailaddress](/forum/35-orders-management/904464-using-a-invoice-emailaddress#341910 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 3.10.8 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Edge  My customer has the following situation: - An employee will order some products. - The company of the customer can pay on account (pays after it). - The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).  I have made a new address fiels called invoiceemailaddess.  Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice. The notifications still needs to send also to the employee (also that he can few the order of cource).  How can i achive this. I can programm is nessesary.")* was created by *[Ginius](/forum/user/39267-ginius "View Ginius's Profile")*

-- HikaShop version -- : 4.5.1
-- Joomla version -- : 3.10.8
-- PHP version -- : 7.4.29
-- Browser(s) name and version -- : Edge

My customer has the following situation:
- An employee will order some products.
- The company of the customer can pay on account (pays after it).
- The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).

I have made a new address fiels called invoiceemailaddess.

Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice.
The notifications still needs to send also to the employee (also that he can few the order of cource).

How can i achive this. I can programm is nessesary.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQ2NC11c2luZy1hLWludm9pY2UtZW1haWxhZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

4 years 5 months ago [\#341912](#341912) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Using a invoice emailaddress](/forum/35-orders-management/904464-using-a-invoice-emailaddress#341912 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 3.10.8 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Edge  My customer has the following situation: - An employee will order some products. - The company of the customer can pay on account (pays after it). - The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).  I have made a new address fiels called invoiceemailaddess.  Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice. The notifications still needs to send also to the employee (also that he can few the order of cource).  How can i achive this. I can programm is nessesary.")*

Hi,

In the file plugins/hikashop/attachinvoice/attachinvoice.php you have this line:
$cc = $this-&gt;params-&gt;get('copy');
It takes the email address you can enter in the settings of the plugin to send a copy of the email with the invoice to it.
So change that line to:
$cc = $order-&gt;billing_address-&gt;invoiceemailaddess;
and it should use the email address entered in that custom address field.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQ2NC11c2luZy1hLWludm9pY2UtZW1haWxhZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 52
- Thank you received: 4
-
-

4 years 5 months ago -  4 years 5 months ago [\#341936](#341936) by [Ginius](/forum/user/39267-ginius "View Ginius's Profile")  Replied by *[Ginius](/forum/user/39267-ginius "View Ginius's Profile")* on topic *[Using a invoice emailaddress](/forum/35-orders-management/904464-using-a-invoice-emailaddress#341936 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 3.10.8 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Edge  My customer has the following situation: - An employee will order some products. - The company of the customer can pay on account (pays after it). - The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).  I have made a new address fiels called invoiceemailaddess.  Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice. The notifications still needs to send also to the employee (also that he can few the order of cource).  How can i achive this. I can programm is nessesary.")*

It is working. Although I changed the line to Code:

// check if there is an invoice-email of the customer $invoice_email = $address-&gt;invoiceemailadres; if (!is_null($invoice_email)) { $mailer-&gt;addRecipient($invoice_email); } //We add an BCC in case of the parameters say so... $cc = $this-&gt;params-&gt;get('copy'); if(!empty($cc)){ $cc = explode(',', $cc); foreach($cc as $c) { if(!empty($c)) $mailer-&gt;addBCC($c); } }

In this case it's added in the to list instead of cc-list.

In both cases it's not recorded in e-mail log. Shoud be nice for track records. IS that possible?

Last edit: 4 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQ2NC11c2luZy1hLWludm9pY2UtZW1haWxhZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

4 years 5 months ago -  4 years 5 months ago [\#341937](#341937) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Using a invoice emailaddress](/forum/35-orders-management/904464-using-a-invoice-emailaddress#341937 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 3.10.8 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Edge  My customer has the following situation: - An employee will order some products. - The company of the customer can pay on account (pays after it). - The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).  I have made a new address fiels called invoiceemailaddess.  Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice. The notifications still needs to send also to the employee (also that he can few the order of cource).  How can i achive this. I can programm is nessesary.")*

Hi,

You can see that you added your code in the function onBeforeMailSend of the plugin. That function name is the event triggered by HikaShop whenever an email is sent.
And that same principle is used by the email history plugin which logs the emails.

So if you don't see the extra information you added in the email history what that means is that the email history plugin is probably triggered by the Joomla plugins system just before the PDF invoice plugin. The order of trigger of the plugins is based on their order you can configure in the plugins manager of Joomla. So I suppose just making sure that the order of the email history is greater than the order of the PDF invoice plugin in the Joomla plugins manager should make it log your modifications.

Last edit: 4 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQ2NC11c2luZy1hLWludm9pY2UtZW1haWxhZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 52
- Thank you received: 4
-
-

4 years 5 months ago [\#341957](#341957) by [Ginius](/forum/user/39267-ginius "View Ginius's Profile")  Replied by *[Ginius](/forum/user/39267-ginius "View Ginius's Profile")* on topic *[Using a invoice emailaddress](/forum/35-orders-management/904464-using-a-invoice-emailaddress#341957 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 3.10.8 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Edge  My customer has the following situation: - An employee will order some products. - The company of the customer can pay on account (pays after it). - The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).  I have made a new address fiels called invoiceemailaddess.  Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice. The notifications still needs to send also to the employee (also that he can few the order of cource).  How can i achive this. I can programm is nessesary.")*

The suggestion you gave sound fair, but seems not be working.

I changed my code a little bit becuase I want to add it to de cc (instead to in the beginning),

The code is:
Code:

// check if there is an invoice-email of the customer $addressClass = hikashop_get('class.address'); $address=$addressClass-&gt;get($data-&gt;data-&gt;old-&gt;order_billing_address_id); $invoice_email = $address-&gt;invoiceemailadres; //We add an BCC in case of the parameters say so... $cc = $this-&gt;params-&gt;get('copy'); if(!empty($cc)){ $cc = explode(',', $cc); foreach($cc as $c) { if(!empty($c)) $mailer-&gt;addBCC($c); } } if (!is_null($invoice_email)) { $mailer-&gt;addCC($invoice_email); }

This is working as i can see in mailtrap.io.
[ ![att&#95;1.png](/forum/attachment/54891) ](/forum/attachment/54891 "att&#95;1.png")

I I look in email-history I see:
[ ![att&#95;2.png](/forum/attachment/54890) ](/forum/attachment/54890 "att&#95;2.png")

As you ca see, the cc-address is missing.

The order of the plugin is as follow:
[ ![att&#95;3.png](/forum/attachment/54892) ](/forum/attachment/54892 "att&#95;3.png")

As last one the email history.

What did i wrong?

- [ ![att&#95;2.png](/forum/attachment/54890) ](/forum/attachment/54890 "att&#95;2.png") [ ](/forum/attachment/54890?download=1 "att&#95;2.png")
- [ ![att&#95;1.png](/forum/attachment/54891) ](/forum/attachment/54891 "att&#95;1.png") [ ](/forum/attachment/54891?download=1 "att&#95;1.png")
- [ ![att&#95;3.png](/forum/attachment/54892) ](/forum/attachment/54892 "att&#95;3.png") [ ](/forum/attachment/54892?download=1 "att&#95;3.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQ2NC11c2luZy1hLWludm9pY2UtZW1haWxhZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

4 years 5 months ago [\#341961](#341961) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Using a invoice emailaddress](/forum/35-orders-management/904464-using-a-invoice-emailaddress#341961 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 3.10.8 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Edge  My customer has the following situation: - An employee will order some products. - The company of the customer can pay on account (pays after it). - The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).  I have made a new address fiels called invoiceemailaddess.  Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice. The notifications still needs to send also to the employee (also that he can few the order of cource).  How can i achive this. I can programm is nessesary.")*

Hi,

Can you confirm that you correctly set the "ordering" setting of both plugins ?
[ i.imgur.com/ypOWBld.png](https://i.imgur.com/ypOWBld.png)
Because the order on the listing is not necessarily correlated to the ordering of the plugins.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQ2NC11c2luZy1hLWludm9pY2UtZW1haWxhZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 52
- Thank you received: 4
-
-

4 years 5 months ago [\#341975](#341975) by [Ginius](/forum/user/39267-ginius "View Ginius's Profile")  Replied by *[Ginius](/forum/user/39267-ginius "View Ginius's Profile")* on topic *[Using a invoice emailaddress](/forum/35-orders-management/904464-using-a-invoice-emailaddress#341975 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 3.10.8 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Edge  My customer has the following situation: - An employee will order some products. - The company of the customer can pay on account (pays after it). - The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).  I have made a new address fiels called invoiceemailaddess.  Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice. The notifications still needs to send also to the employee (also that he can few the order of cource).  How can i achive this. I can programm is nessesary.")*

Hi,

I don't see the Hiksshop action log. I only have Joomla Action log.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQ2NC11c2luZy1hLWludm9pY2UtZW1haWxhZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

4 years 5 months ago [\#341976](#341976) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Using a invoice emailaddress](/forum/35-orders-management/904464-using-a-invoice-emailaddress#341976 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 3.10.8 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Edge  My customer has the following situation: - An employee will order some products. - The company of the customer can pay on account (pays after it). - The invoice needs to be end to the invoice depertment of the company (other e-mailadress then the one of the user).  I have made a new address fiels called invoiceemailaddess.  Hoe can i set it up in a sich way that the invoice is send to the department and not to the e-mailadress of the user? I'm unsing PDF Invoice. The notifications still needs to send also to the employee (also that he can few the order of cource).  How can i achive this. I can programm is nessesary.")*

Hi,

No, I'm talking about the "ordering" option of the PDF invoice and the email history plugins. The action log plugin has nothing to do with this. I just openned the first plugin I saw on my plugins listing to make the screenshot of the "ordering" setting. Sorry if that was confusing.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQ2NC11c2luZy1hLWludm9pY2UtZW1haWxhZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.090 seconds

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