PHP code editing for email generation via DB

PHP code editing for email generation via DB

Closed - This job posting has been filled and work has been completed.

Job Description

Hello...i currently have a script that generates an email with a PDF attachment via a mySQL database...the database is used for an application i currently use...i schedule the email letters via the application and i currently run a specific PHP script to trigger sending the email. I would like to do something different so i can make the process more efficient...

there are 4 scripts for 4 different emails.
i schedule the 4 different emails based on the field LETTER_TYPE in the application and the application stores the letter type in the DB.
i execute and trigger sending the letter by running the SPECIFIC PHP script for thatr letter type via a web browser on the local network...

i would like to set it up so that there is only one php with if/then statements that check the variable letter type and based on that send the appropriate letter. also it should loop so that if there are more than one letter letter to send, it loops till there are no more "scheduled" letters and all the letters have a "sent" status.

this is all working and the letters send fine and update the sent status, but i just am tired of having to run 4 different scripts for 4 different letters...i need to add 4 more letters and i would like to have the script pull the letter type from the database and not just from the script alone...
also the letters are currently written to a directory on the server. i would like to appent the letter type and a timestamp to the lettter name to make it unique so the letters are not over written and i have a history of the letter creation.

anyone with good PHP skils with find this stupid easy...i need this done asap and want to ensure the most scalable solution is made...

---
Skills: pdf