@SLEDGE
I /need/ your server-side expertise here. So I just started at the farmer's market today and made...well... $3. But in cash so that's cool.
Anyways, the guy next door uses Square, and doesn't use a receipt printer. If you saw one of my earlier posts, you'll see that even though my Chromebook has a nice, big screen for Square, it doesn't communicate with external devices. I can send receipts through Square via email though. I already tested it and an ugly page with a faded Square logo and crap comes out. No actual receipt info. I think it's because the email is HTML and HP ePrint can't interpret it.
I was wondering if there was a way to use my own email address (ex. receipts@xbit.technology) and intercept incoming mail (the Square receipt) and use PHP to convert it into an image/PDF, then forward the finalized receipt to my printer. Is this possible? If it is and you can give me some links explaining me how to do this, I can save over $200 by returning the LAN printer I recently bought...Please and thanks. <3
Please Login To Post
That's pretty cool.
The file does exist though... So I'm not sure why it's doing this. No big deal though I think, considering people still haven't been asking for receipts. ^_^
Sets it to $email. I didn't give you that bit cause I figured one of the newer parser libraries would probably do it for you.
But how do I access the email contents from the script itself? Is there a variable name?
It looks like there are a lot more resources for parsing emails with PHP than there were when I did it a few years ago so I'd look into those and get back to me if you have an issue. I had to frankenstein a bunch of parsers together to get mine to work so it isn't pretty. The hardest thing about it is different senders sending things in different ways though so since you are going to be getting a consistent format it should be pretty easy regardless.
Once you have the email content you can convert it to a PDF using the html2pdf PHP library and send it on to your printer.
Basically, I have my printer set up with an email address and I can email to *hiddenaddress*@hpeprint.com and it prints. You could be able to set up an email forwarder to do the same. I don't remember how much my printer costed, but my family bought it a few years ago.
Uh. On second thought never mind. If a payment processor dropped me I could just re-order the thermal printer if I ever actually needed it again. For cash transactions I could always just open the drawer manually I suppose.