-- url of the page with the problem -- : local MAMP Pro 2.2
-- HikaShop version -- : 2.3.1 Biz & 1.4.1 Market
-- Joomla version -- : 3.3
-- PHP version -- : 5.3.27
-- Error-message(debug-mod must be tuned on) -- : niente
Oh well. Got the lovely PDF invoice plugin doing exactly what it's supposed to do (and styled!). Got the email 98% styled and all working like a dream. Now, with the attempt of attaching a file to a mail, a nightmare has spoiled the fun.
Where do I start? It's really crazy. "Oh no, one of these posts...", I hear you saying. Well, sorry. You'll see, it IS truly complicated.
Prolog:
- Just for the record, I am attaching my mail setup as far as you might think it's relevant. The present setup is what I want/need, I guess - but caution: the problems are totally NOT depending on these settings. I've spent lots of time to go through all combos of the switches, it's all the same. No worries, I spent longer testing and searching than writing this, haha.
- As usual, for testing I've removed all relevant customisations. Doesn't matter, probe persist.
- Generally, all mails - other Joomla native or extensions, and definitely HikaShop/Market - are working p-e-r-f-e-c-t-l-y well. Actually, even if I attach a file. Except the file doesn't stick to the mail or makes it over all the time.
- With images in the mails (products, logo, social icons) NO problem at all, no matter if embedded or not. With file attachment... uh oh.
- HikaShop and -Market behave slightly different, strangely (see below), but please don't send me to Jerome, it's common knowledge that Market mails are tied into the Shop, and the difference is rather... hmm, "minor".
- I so fear that I'm the only one with these symptoms. Again. But the symptoms are neither pointing at the (local) PHP mail server, nor at my customisations or other self-inflicted crap. As you shall see.
What I want to do:
- Attach a file (always one and the same) to one mail (only one, and always the same).
- It's a Market mail (read on, please!), the first and only Market mail that goes out in the order process: an order status notification ("paid"), which shall have a file attached to tell the vendor how to prepare the shipment and all that (won't fit nicely in the mail body). The simultaneous customer mail must NOT have this file attached, obviously. Note: This mail has images either linked or embedded - works fine. It has no other file attachment, e.g. the vendor doesn't get the PDF invoice at all, and that's nicely out to the customer one status earlier already.
What works fine:
- Attaching a file to Shop mails. Well, sometimes. But generally yes. (Only, I don't want that. Except for the PDF invoice, and that does always work fine.)
- Attaching a file to the Market mail. But only if I use a trick (see below). And only (only!) if I attach it to the Shop mail. See, I'm going nuts. True: If I attach a file to that "paid" status Shop notification, the vendor mail has it also attached. Also if it's attached exclusively to the Shop mail, not to the Market mail. What I do on the Market side doesn't matter. True also for any positioning of config switches (they do what they're supposed to do, except for helping with the problem).
Now, here's the fun part:
What does NOT work:
- Saving the attached file safely and lastingly to a mail without losing it again. For both Shop and Market mail.
- If I attach a file and "save", it sticks. I leave the page open and can refresh it as often as I want, it's still there. But if I click "save & close", the next time I open the mail editor, the attachment is gone. Really. Not there anymore. Duh. Not showing in the mail editor anymore, not in the database anymore. Gone. It is still in the upload directory, though (where all files ever attached stay forever, intentionally removed or accidentally, unless manually deleted - as opposed to images, like it or not). If I smuggle my way out of editing/attaching ("save", then "cancel"... NOT "close"!), the file sticks, shows in the database etc, and if it's a Shop mail, it gets mailed out. Only to both, customer and vendor. Always. Bah. And only if it's a Shop mail.
- If I manage to attach it to the Market mail only and keep it sticking, nothing happens. Like a shop mail attachment, it's in the upload directory, it shows in the database (correctly in a different field than Shop files: table "#_hikashop_config", field "market.order_status_notification.attach", value
a:1:{i:0;O:8:"stdClass":2:{s:8:"filename";s:8:"test.pdf";s:4:"size";i:211647;}}
but it doesn't get mailed out. Not to the customer (good), not to the vendor (bad!). Never ever any attachment, then. But hey, YOU go and bug Jerome for this specific thing...
See, needed to tell you the whole story, so you can chew on these points it boils down to:
(a) In both Shop and Market, mail attachments don't stick if clicking "save & close". They're not getting mailed anywhere, they're not in the database anymore, and consequently not showing as attachments in the mail editor anymore when re-opening it, but they're still under "upload".
(b) Mails with or without attachments work perfectly fine - if you make attachments 'stick with a trick' (don't "close" but "cancel"), but only when attached to Shop mails. Then they also arrive with the Market mail.
(c) Attachments to Market mails don't go anywhere, even if they stick in the system. They can be made to stick, but are always stuck. Even if they are everywhere: in the editor, in "upload", and in the database. The vendor gets his mail, but no attachment.
(d) It. Does. Not. Matter. What. Config.
(e) It's not random. It's very well reproducible.
(f) It can't be me. Or my server. Or the weather here. Maybe my wife. But not me or the server.
You also nuts? Good, welcome to the
club.
T