So I have a bit of a complicated question, and I'm not even sure if this is even possible, but please leave any suggestions.
I am looking for a way to send precomposed drafts made in GMail through PHP. This will be used for an (semi-)automated payment confirmation system. This is the outline of the system:
- Customer comes in with a request.
- Company writes e-mail in advance, which should be sent as soon as the customer pays. This e-mail contains some text and an attachment.
- Customer pays.
- Payment system sends a message to my server. My script extracts all the information needed.
- Script accesses GMail account and sends the existing draft (which can be distinguished by looking at the subject).
Basically what I need is a way to implement step 5.
Again, this is probably a long shot but any help is appreciated.
Do you know Gmail API? You can create drafts, send emails and attach documents from PHP.