Add attachment to admin e-mail from custom field

  • Posts: 18
  • Thank you received: 2
9 years 6 months ago #200766

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29

I have a custom field which allows customers to upload a file during the checkout process. I'd like to add the file that they uploaded as an attachment to the email that notifies the admin of a new order. In this case, the custom field is in the "order" table, with the column name "uploadacopyofpo".

Is there any direction that you can provide for adding this? I know that there's already a link included in the e-mail that allows the admin to login and access the download, but I would like to have it as an attachment.

Thanks!

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 6 months ago #200776

Hi,

You would have to edit the email via the menu System>Emails and add custom code for that.
Here is a thread with some indications:
www.hikashop.com/forum/2-general-talk-ab...fication.html#141160

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

  • Posts: 8
  • Thank you received: 0
9 years 5 months ago #203498

Hello Nicolas,

I guess this case is a bit different. Here www.hikashop.com/forum/2-general-talk-ab...fication.html#141160 somebody wants to add a attachment depending on the product.

mj just wants to have the file from the custom field added, when the user uploaded something.
I also have this problem and the hints in the post you adressed are a bit unspecific.

Can you please provide a bit more information? How is it possible to add the custom field attachment to an e-mail?

Thanks!

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 5 months ago #203503

HI,

The other thread solution indeed needs to be adapted.

I suppose that you would want to write something like this in your emails that you can edit via the menu System>Emails:
<?php $this->mailer->AddAttachment($path_to_the_file); ?>

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

  • Posts: 8
  • Thank you received: 0
9 years 5 months ago #203533

But <?php $this->mailer->AddAttachment($path_to_the_file); ?> will be the same file in all cases right?
In my case it should be the file, which the user uploaded during the checkout. I have a custom field with type "attachment". But it makes no sense, if I won't get the file in the confirmation mail.

Thanks in advance!

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
9 years 5 months ago #203544

Hi,

So you will have to put the right file path in the variable $path_to_the_file ; by reading the file uploaded by the customer during the checkout for example.
It will require some PHP development, but it's something possible.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.072 seconds
Powered by Kunena Forum