I need a gearman worker written in perl that does the following. If you have not worked with gearman before it is the cutting edge technology to help with distributed processing: [url removed, login to view]
The worker I need to be built needs to do the following:
1.) It gets an unique ID and an alert event for e.g. (ID became active or inactive) as part of the params
2.) Fetch a list of email addresses that are associated with that unique ID and sends out an email including the alert event
3.) Need to use google email to send out emails and I can provide authentication and a from email address once the bid is accepted
I am using the following libraries for other gearman workers on this project, so will be best if we can use the same libraries for this project as well.
use Gearman::XS qw(:constants);
To retrieve the list of email addresses you need to call a couple of URLs that will return a JSON response:
At first you need to make this call:
[url removed, login to view]
where you replace 189 with the ID passed to the worker
from this retrieve the "company_id"
Also, please retrieve and save coupon_text and product from this document as well because you will need it to include in the email notifications
Then you call this URL:
[url removed, login to view]"Company-1"
where key="Company-1" will be replace with "key="company_id" retrieved from the first call
Please make the following things configurable through an ini file:
URLs to call to retrieve a list of email addresses
connection parameters and "from" address for google mail
Email notification should look like:
An alert has been issued for the following:
(Both these values retrieved from the URL)
alert: (send as an event to the gearman worker)
If you have any questions please feel free to contact us.
I also have some perl based workers also running, so if you need some sample code I can also provide that.