A specific email account receives the invoices from the invoicing application.
The invoice is attached to the email as a pdf file.
The task to be done:
1. Connect to the account through IMAP in PHP
2. Read and process those emails which were not processed yet
3. Read out the following fields from the PDF invoices: Customer email address; Customer name; Invoice number; Order number; Payment type
(the structure of the PDF files will not change, East-European UTF-8 characters are involved)
4. Save the Invoice number - Order number pair into the database (I will do it after having the pair)
5. Rename the attachement (in the forwarded email) like: Customer_name_Invoice_Number_(Order_number).pdf
6. Forward the attachement to another (fix) email address with the title (through SMTP):
Invoice Customer_name << Invoice_Number >> (Order_number, customer_email_address)
7. If Payment type = cheque, then forward the attachement to another email address too.
8. Close the process, register which incoming emails were already processed
Meaning (translation) of key fields:
Email - Customer email address
Vevő - Customer name
Számlaszám (utalásnál beírandó) - Invoice number
Rendelésszám - Order number
Fizetés módja - Payment type