How to attach a file to emails

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
7 years 7 months ago #249970

How can i attach a file (pdf) to any order confirmation email.
I need to attach some special reports each time i change order status, how can i do that?

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #249977

Hi,

You can edit the order status notification email via the menu System>Emails and add your attachment there. It will be added to all the order status notification emails sent.

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

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
7 years 7 months ago #250096

The problem is that i need to attach a different pdf each time.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #250102

Hi,

There is no interface to attach a file directly when you change the status of an order.
An alternative could be to create a custom field of the table "order" and of the type ajax file so that you could upload the file on the order details page, and it would then be added to the email automatically as a link. And the customer could also get the link on the frontend, when looking at the order details.
If you really want the file to be attached, then it would require some code customization.

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

  • Posts: 18
  • Thank you received: 0
7 years 6 months ago #251686

There is a workaround.
In the preload (for instance order_admin_notification.preload.php) you can generate a pdf with TCPDF or FPDF or any pdf-generator you like. Then you output the pdf-file to a folder.
In the preload you can determine where the pdf-file is stored and this way you can even enhance the $vars array() with the path and filename of that pdf.

In the html file you can simply make a link to that pdf file. You receipient gets the e-mail, clicks on the link and voila: he/she has the pdf on his/her screen. From there on the pdf can be printed or locally saved.

Hope this helps.

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

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
7 years 6 months ago #251733

wow, that is really complicated way to do that :)
i think that this future should be integrated in next Hikashop releases as default. Is there any way to ask them to do that?

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

  • Posts: 18
  • Thank you received: 0
7 years 6 months ago #251756

@arnask This has allready been asked several times. I expect this will be implemented somewhere in the future.

On the other hand I think that a solution as I described has several advantages. In my shop I have made a link to all the client's documents and I do not mail attachments anymore. When a usert is logged in, he can view, print and download any document via the user menu.

This way I try to do my small bit in reducing network traffic. The downside may be that all documents are stored on the server, but those few MB's are a small contribution to the problem and it saves me a lot of time and telephone calls. Any logged-in user can see his own administration.

Once you have set up a good pdf generating stucture it will be a piece of cake.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 6 months ago #251745

Hi,

HikaShop have plugins like "PDF Invoice" or add-ons like "HikaSerial" which can include dynamically files to emails.
It means that HikaShop already have triggers and entry points for plugins to do so.
But, as part of "dynamic" it means that you need something with the algorithm ; something specific, something custom.

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.

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
7 years 6 months ago #251837

i have a "PDF invoice" plugin, but the problem is that i need to attache a different pdf each time i change order status. These pdf's is very confidential, so i can not allow them to be stored on server.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 6 months ago #251842

Hi,

So my previous message is without no doubt, your answer.
You need a custom plugin to attach files dynamically generated ; exactly like HikaSerial is doing with the same plugin entry point used by the "PDF invoice" one.

www.hikashop.com/support/documentation/6...tml#onBeforeMailSend
By accessing to the Joomla PHPMailer object before an email is send ; you can attach a file to it.

docs.joomla.org/Sending_email_from_extensions
github.com/joomla/joomla-cms/blob/stagin....phpmailer.php#L2908

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.

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
7 years 6 months ago #251986

The files i need to attache is not generated. Its from totally different platform.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 6 months ago #252012

Hi,

Sure but that doesn't change our answer. You still need to have a small custom plugin to add these files to the emails.

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

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
7 years 6 months ago #252106

is it possible, that sometime it will be implemented in Hikashop?

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 6 months ago #252115

Hi,

As the files come from a totally different plateform, it probably would require a custom plugin to be developed specifically for that plateform

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

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
7 years 6 months ago #252207

These files (pdf's) just exists, no need to create them. I'm receiving it by email. Is there anybody who can do it. I can pay for that.

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

  • Posts: 12953
  • Thank you received: 1778
7 years 6 months ago #252234

Hello,

If you need the help of a professional developer you can check our partners section : www.hikashop.com/home/our-partners.html
Or our commercial jobs section : www.hikashop.com/forum/9-commercial-jobs.html

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

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
6 years 1 month ago #289276

hi nicolas,

i did custom order ajax file field. The descriptions shows: "No files - Drag & Drop here or use the upload button". But it can only accept one file. I need to add more files. And description says that "Files", not "File". How can i upload more then one file?

I also dont want the user to see this field when ordering, only in order details page and set custom items display options as this:


It does not displaying when ordering, but also is not displaying in details page for user. How to do a setup, that user could only see this field in order details page?

Attachments:
Last edit: 6 years 1 month ago by arnask.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 1 month ago #289284

Hi,

You can only upload one file for one custom field.
Changing that would be really complex.
It would be simpler to create several custom fields.
The "fornt-end order details page" display option allow you to display a download link for the file that was previously uploaded through this field on the order details page.
If you didn't use the field on the checkout or in the order details page in the backend to upload a file, then the custom field is empty and thus the download link won't be displayed.
There is no option to have the upload interface to appear on the order details page of the frontend.
That page is supposed to display the information of the order to the customer. He is not supposed to be able to change anything.
If you want to change that and have upload fields there, it would require some custom development.

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

Time to create page: 0.112 seconds
Powered by Kunena Forum