HUB
Sign inSign up
tfk-recruitment-sendmail logo

telemark/tfk-recruitment-sendmail

By telemark

•Updated over 9 years ago

Service to send mail if there are new openings

Image
0

6.4K

telemark/tfk-recruitment-sendmail repository overview

js-standard-style Build Status Greenkeeper badge

⁠tfk-recruitment-sendmail

Sends mail if there are new openings

⁠Requirements

You'll need a SendGrid⁠ account and an API-key.

You'll need an API for recruitments similiar to the one used by Telemark fylkeskommune⁠.

⁠Installation

$ git clone [email protected]:telemark/tfk-recruitment-sendmail.git

⁠Setup

$ npm run setup

⁠Test

$ npm test

⁠Usage

'use strict'

var recruitmentsSendMail = require('tfk-recruitment-sendmail')

var options = {
  apiKey: 'your-sendgrid-api-key',
  apiUrl: 'https://api.t-fk.no/recruitments',
  mailTo: '[email protected]',
  mailFrom: '[email protected]',
  mailCc: '[email protected]'
}

recruitmentsSendMail(options, function (error, data) {
  if (error) {
    console.error(error)
  } else {
    console.log(data)
  }
})

Example of returned data

Found a total of 11 jobs
This job is fresh! https://hrm.btvregion.no/tfk_recruitment/jobid/2633
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2665
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2666
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2662
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2638
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2639
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2656
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2651
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2652
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2654
This job is previously published: https://hrm.btvregion.no/tfk_recruitment/jobid/2655
Mail delivered
{"message":"success"}
{ jobsDone: 11, newJobs: 1, oldJobs: 10 }

⁠Docker

To run this module as a service use the docker image.

Change the ENV parts of the Dockerfile⁠ or use docker.env⁠

Build

$ docker build -t tfk-recruitment-sendmail .

Run a container

$ docker run --rm tfk-recruitment-sendmail 

or

$ docker run --env-file=docker.env --rm tfk-recruitment-sendmail 

This will spin up a container. Do the jobs. Shut it down and remove it.

⁠License

MIT⁠

alt text

Tag summary

Content type

Image

Digest

Size

28.7 MB

Last updated

over 9 years ago

docker pull telemark/tfk-recruitment-sendmail:master