Newbie Question - JSON, MySQL

I would like to connect to external resource and query records(customer,email) for a specific time frame and then retrieve them to either send an email from a script or store them into a database, then send the email. I’m thinking that storing into the db then sending the email would be best practice?

Not sure where to start.