How did you decide that it would take you about two days? Was it just a number or did you try and break down the task into sub tasks and decide how long each would take?
Well, I took a look at the Sendgrid api page, and decided whether to use their built in API or their web API over JSON, and since I had used cURL quite a few times, it seemed a simpler task to implement it myself.
I then took a look at the analytics and the database makeup and a break down of tasks which I needed to accomplish were as thus (I was told by my manager to make product_name work with Sendgrid - that's it):
- Connect to the database
- Query recently added "leads"
- Grab lead email information and funnel_id
- Grab template and cache it (multiple emails can use the same template, and there are standard templates, making a query for every single template would make database IO a real issue)
- Build up the emails in to an Array, complete with template reference and replaced [TAGS] (full name, etc) required by each individual email
- Actually initialize cURL, create the multi_curl_init objects and loop through, check each request for the {success} JSON object returned by Sendgrid and reschedule / show an error in our logs for that email funnel
- Clean up after ourselves, rinse and repeat 10 minutes later for the next lot of leads.
- debug
In all honesty, the only way I knew the length of time required was breaking down an estimate for each individual task and then adding them all up and doubling it. It was an "intuitive guess".
Comments
How did you decide that it would take you about two days? Was it just a number or did you try and break down the task into sub tasks and decide how long each would take?
Well, I took a look at the Sendgrid api page, and decided whether to use their built in API or their web API over JSON, and since I had used cURL quite a few times, it seemed a simpler task to implement it myself.
I then took a look at the analytics and the database makeup and a break down of tasks which I needed to accomplish were as thus (I was told by my manager to make product_name work with Sendgrid - that's it):
- Connect to the database
- Query recently added "leads"
- Grab lead email information and funnel_id
- Grab template and cache it (multiple emails can use the same template, and there are standard templates, making a query for every single template would make database IO a real issue)
- Build up the emails in to an Array, complete with template reference and replaced [TAGS] (full name, etc) required by each individual email
- Actually initialize cURL, create the multi_curl_init objects and loop through, check each request for the {success} JSON object returned by Sendgrid and reschedule / show an error in our logs for that email funnel
- Clean up after ourselves, rinse and repeat 10 minutes later for the next lot of leads.
- debug
In all honesty, the only way I knew the length of time required was breaking down an estimate for each individual task and then adding them all up and doubling it. It was an "intuitive guess".