I’m integrating my website with a third party system. Here’s the workflow between my website and the third party system:
1) From my website, I use PHP to automate upload of a CSV file to the third party system.
2) After the third party system receives my file, it will conduct a few operations.
3) The third party system will email john@mydomain.com a list of successful and failed operations including any error messages.
4) My website needs to record the list of successful/failed operations in the confirmation email.
5) My website performs operations based on which items were successful/failed in the confirmation email.
First question:
What do I need to research to be able to implement #4?
Second question:
Is parsing a confirmation email the best way to record the successful/failed operations of the 3rd party system? It feels like a problematic way of getting to step 5 (for example, what if the language in the email changes? Then i have to rewrite the parser”.
Well, obviously a better way would be some sort of push from the 3rd party system to a script on your end, following a defined convention of parameters.
If there is any chance to do so, talk to the 3rd party whether such a way can’t be implemented somehow. It could be very little work on their end.
To parse E-Mail:
The standard method in PHP to check POP3 and IMAP mailboxes is here
What you need to parse the E-Mails themselves depends on what they look like. Probably regular expressions will be involved.