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

#   Order mail to to a second custom field email address

##

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

Less More

- Posts: 3
- Thank you received: 1
-
-

4 months 3 weeks ago [\#372491](#372491) by [thomas@eilers.hamburg](/forum/user/82175-thomas-eilers-hamburg "View thomas@eilers.hamburg's Profile")  *[Order mail to to a second custom field email address](/forum/27-checkout/910647-order-mail-to-to-a-second-custom-field-email-address#372491 "-- HikaShop version -- : HikaShop Business 6.5.0 -- Joomla version -- : 5.4.6 -- PHP version -- : 8.2.30 -- Browser(s) name and version -- : Firefox 152.0.4  Hi, I need to find a solution where my customers have the possiblity to add another email address in the shipping address. Most probably this can be done via the custom fields via a new field which will be displayed in the shipping address aera. But how to ensure that the order confirmation and the PDF invoice will be sent to this email address, too.  Thanks, Thomas")* was created by *[thomas@eilers.hamburg](/forum/user/82175-thomas-eilers-hamburg "View thomas@eilers.hamburg's Profile")*

-- HikaShop version -- : HikaShop Business 6.5.0
-- Joomla version -- : 5.4.6
-- PHP version -- : 8.2.30
-- Browser(s) name and version -- : Firefox 152.0.4

Hi,
I need to find a solution where my customers have the possiblity to add another email address in the shipping address.
Most probably this can be done via the custom fields via a new field which will be displayed in the shipping address aera.
But how to ensure that the order confirmation and the PDF invoice will be sent to this email address, too.

Thanks,
Thomas

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkxMDY0Ny1vcmRlci1tYWlsLXRvLXRvLWEtc2Vjb25kLWN1c3RvbS1maWVsZC1lbWFpbC1hZGRyZXNzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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: 86587
- Thank you received: 14326
-
-

4 months 3 weeks ago [\#372497](#372497) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Order mail to to a second custom field email address](/forum/27-checkout/910647-order-mail-to-to-a-second-custom-field-email-address#372497 "-- HikaShop version -- : HikaShop Business 6.5.0 -- Joomla version -- : 5.4.6 -- PHP version -- : 8.2.30 -- Browser(s) name and version -- : Firefox 152.0.4  Hi, I need to find a solution where my customers have the possiblity to add another email address in the shipping address. Most probably this can be done via the custom fields via a new field which will be displayed in the shipping address aera. But how to ensure that the order confirmation and the PDF invoice will be sent to this email address, too.  Thanks, Thomas")*

Hi Thomas,

There is no built-in option to route the order emails to an address typed into a custom field, but it only takes a couple of steps.

1) Create the field
In System &gt; Custom fields, add a new field with the Table set to "Address" and a column name of your choice (for example extra_email). Use the "Text" type and, if you want it validated, add an email regex in the field options. It will then appear in the billing/shipping address form on the checkout.

2) Copy the order emails to that address
The order confirmation and the invoice both go out through HikaShop's emails, and the mail object accepts a cc_email (or bcc_email) that is read when the email is sent. So in System &gt; Emails, edit the "Order creation notification" email and paste this at the very top of the HTML body:
Code:

&lt;?php $extra = trim(@$data-&gt;cart-&gt;shipping_address-&gt;extra_email); if(!empty($extra)) $mail-&gt;cc_email = empty($mail-&gt;cc_email) ? $extra : $mail-&gt;cc_email.','.$extra; ?&gt;

Replace extra_email with the column name you gave the field (and shipping_address with billing_address if you put the field on the billing address). Use $mail-&gt;bcc_email instead of cc_email if you would rather the extra address stays hidden from the customer.

The PDF invoice is attached to the "Order status notification" email (depending on your invoice settings), so add the same three lines to that email too if you want the invoice copied to the field address as well.

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

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

Less More

- Posts: 3
- Thank you received: 1
-
-

4 months 3 weeks ago [\#372505](#372505) by [thomas@eilers.hamburg](/forum/user/82175-thomas-eilers-hamburg "View thomas@eilers.hamburg's Profile")  Replied by *[thomas@eilers.hamburg](/forum/user/82175-thomas-eilers-hamburg "View thomas@eilers.hamburg's Profile")* on topic *[Order mail to to a second custom field email address](/forum/27-checkout/910647-order-mail-to-to-a-second-custom-field-email-address#372505 "-- HikaShop version -- : HikaShop Business 6.5.0 -- Joomla version -- : 5.4.6 -- PHP version -- : 8.2.30 -- Browser(s) name and version -- : Firefox 152.0.4  Hi, I need to find a solution where my customers have the possiblity to add another email address in the shipping address. Most probably this can be done via the custom fields via a new field which will be displayed in the shipping address aera. But how to ensure that the order confirmation and the PDF invoice will be sent to this email address, too.  Thanks, Thomas")*

Hi Nicolas,

it works perfect!

I have created another question in a new chat. Thanks a lot.

Regards,
Thomas

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

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

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