{"id":19408891,"url":"https://github.com/4lessandrodev/cron_job_to_send_emails","last_synced_at":"2025-10-25T00:02:33.820Z","repository":{"id":105006012,"uuid":"383596275","full_name":"4lessandrodev/cron_job_to_send_emails","owner":"4lessandrodev","description":"Uma pequena brincadeira com cronjobs. Buscar notificações em duas tabelas do banco SQL e enviar os dados por email em um horário programado","archived":false,"fork":false,"pushed_at":"2021-07-09T00:34:18.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T15:48:44.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4lessandrodev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-06T20:57:02.000Z","updated_at":"2021-07-09T00:34:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"40333418-4c43-465c-b30f-82d8cea98a75","html_url":"https://github.com/4lessandrodev/cron_job_to_send_emails","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/4lessandrodev/cron_job_to_send_emails","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fcron_job_to_send_emails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fcron_job_to_send_emails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fcron_job_to_send_emails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fcron_job_to_send_emails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4lessandrodev","download_url":"https://codeload.github.com/4lessandrodev/cron_job_to_send_emails/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fcron_job_to_send_emails/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001647,"owners_count":26083147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T12:08:26.289Z","updated_at":"2025-10-09T15:48:45.114Z","avatar_url":"https://github.com/4lessandrodev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cron job for send notification\n\n### Get all notification on database\n\nRequirements\n\n- make sure you have a database with the table as in the script example `migration.sql`\n- make sure you have entered the credentials in the .env file\n- make sure you have nodeJs installed\n- make sure you have installed all dependencies `yarn intall`\n- make sure your user table on column `notification_mail_preferences` look like the exemple bellow\n- make sure you have a valid email user account\n\n```json\n{\n\t\"late_task_follower\": true,\n\t\"late_task_responsible\": true\n}\n```\n\n- make sure you have set the default cron\n- you can use Cronhub to create your pattern\n  https://crontab.cronhub.io/\n\n---\n\n## How to run this project?\n\n\u003e ⚠️ **You can jump step one to seven**: If you Import `getData` function from `data.fake.js` instead `data.js` on `index.js`\n\n- Run optionally docker compose `docker-compose up -d` or if you have postgressql installed on you computer just ignore this step\n- Connect to your postgres `psql -U postgres -h localhost -p 5432 -d test_cron_db`\n- Create your database `CREATE DATABASE test_cron_db;`\n- Create valid fake email (you can use https://temp-mail.org/') and update them on migration.sql script line 33\n- Create your table: Copy the commands script on migration.sql and paste on your terminal\n- Check if tables were created: `\\dt`\n- Exit your postgres terminal connection: `\\q`\n- Create your `.env` file with your credentials\n- You may use a fake smtp email service like `mailtrap` https://mailtrap.io/fake-smtp-server/\n- `$ yarn start`\n- Wait until timer match. Default timer is 5 minutes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fcron_job_to_send_emails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4lessandrodev%2Fcron_job_to_send_emails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fcron_job_to_send_emails/lists"}