Add a pending check payment notification email to webjobs

Problem: If you have enabled “Notify admin of new job postings?:” from Admin Area -> Email Notification, an email will be sent to the Admin notifying him when a job has been posted. However, if check payment is selected there will be no email sent to the admin.

In theory, I guess the email ISN’T needed because it is assumed that the siteowner doesn’t need to worry about activating the job until the check is received. However, on one Webjobs site I used the check module as a request from the employer to be invoiced, instead of paying by credit card. The siteowners had to remember to check the Pending Check area in Smartway to see if any employers were waiting to be invoiced.

Solution: Thanks to the new upgraded Webjobs 2.0, the solution is now very simple. Previously, it was difficult to figure out where to generate the email , because of the long posting process (post_single_job2, post_single_job3, confirm_purchase, etc. Where does it go??). Fortunately, this version has a new file — engine/pages/check.php that makes it easy to send the email at the right time in the posting process.

In engine/pages/check.php, insert the following line 4 lines from the bottom of the page, before the closing } .

mail(”recipient-emailaddress“, “New Job Posting in Check Status”, “An employer has a job that is in \”Check\” Status. Please login to the Pending Check area in Smartway to approve this job.”, “From: sender-emailaddress“);

Where the recipient is probably the site admin and the from is also probably the site admin. You could probably replace these with

$application->config(’admin_mail’)

Of course this is an extremely simple email. It would be quite simple to add additional formatting to the email — perhaps a link to the pending check area in Smartway — and additional information about the job posted, perhaps the job id, employer name and company, etc. All that is necessary is a simple select query.

Stumble it!

Leave a Reply