E-mail to Custom field

  • Posts: 206
  • Thank you received: 10
  • Hikashop Multisite
2 years 9 months ago #339200

-- HikaShop version -- : 4.4.5

Hi,

I would like to email the orderstatus to a Hikashop User Custom Field.
I have created a field (user_customemail) and in the CC of the email {VAR:customer.user_customemail}
This doesn't seem to work.

On Google i found this plugin: www.hikashop.com/support/documentation/3...iltocustomfield.html
But i can't find it on my installation.

What is the way to get this work?
Thanks in advance!

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 9 months ago #339201

Hi,

So if I understand correctly, you want to send the "order status notification" email to the email address filled in the custom user field with the column name "user_customemail" instead of the normal user_email field.
It's possible but it requires modifying the "preload" section of the "order status notification" email via the menu System>Emails.
There, you need to add such code at the end :

$data->customer->user_email = $data->customer->user_customemail;

Please Log in or Create an account to join the conversation.

  • Posts: 206
  • Thank you received: 10
  • Hikashop Multisite
2 years 9 months ago #339221

Not exactly, i need this customemail as an additional address in the CC.
The user_email needs to be the usual emailaddress.
But some clients (not all) need to send their invoices also to an invoice/bookkeeping-emailaddress.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 9 months ago #339236

Hi,

In that case, you should be able to do it with this code:

$this->mailer->addCC($data->customer->user_customemail);

Please Log in or Create an account to join the conversation.

  • Posts: 206
  • Thank you received: 10
  • Hikashop Multisite
2 years 9 months ago #339332

Hi,
I have added this code at the end of the preload field in the email setting.

But no emails are sent to the CC.
In the email history i also see the CC is empty.

Is there something else i need to setup?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 9 months ago #339334

Hi,

Try like this instead then:

$mail->cc_email = $data->customer->user_customemail;

Please Log in or Create an account to join the conversation.

  • Posts: 206
  • Thank you received: 10
  • Hikashop Multisite
2 years 9 months ago #339375

Thank you, this works fine!

Please Log in or Create an account to join the conversation.

Time to create page: 0.047 seconds
Powered by Kunena Forum