{"id":15583130,"url":"https://github.com/tanhongit/send_mail_background_job","last_synced_at":"2026-01-19T13:33:08.559Z","repository":{"id":39012159,"uuid":"281088173","full_name":"tanhongit/send_mail_background_job","owner":"tanhongit","description":"Send mail background job Rails 6 with gem sidekiq","archived":false,"fork":false,"pushed_at":"2023-01-19T20:36:26.000Z","size":22063,"stargazers_count":1,"open_issues_count":32,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T21:45:42.585Z","etag":null,"topics":["backgound-job-mail","background-jobs","gem-sidekiq","rails","rails-send-mail","rails6","ruby","ruby-on-rails","sendmail","sidekiq","tanhongit","tanhongit-rails"],"latest_commit_sha":null,"homepage":"https://tanhongit.github.io/send_mail_background_job/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tanhongit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-07-20T10:38:46.000Z","updated_at":"2021-03-20T20:06:37.000Z","dependencies_parsed_at":"2023-02-06T06:31:44.571Z","dependency_job_id":null,"html_url":"https://github.com/tanhongit/send_mail_background_job","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tanhongit/send_mail_background_job","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fsend_mail_background_job","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fsend_mail_background_job/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fsend_mail_background_job/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fsend_mail_background_job/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanhongit","download_url":"https://codeload.github.com/tanhongit/send_mail_background_job/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhongit%2Fsend_mail_background_job/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28569233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["backgound-job-mail","background-jobs","gem-sidekiq","rails","rails-send-mail","rails6","ruby","ruby-on-rails","sendmail","sidekiq","tanhongit","tanhongit-rails"],"created_at":"2024-10-02T20:05:02.149Z","updated_at":"2026-01-19T13:33:08.537Z","avatar_url":"https://github.com/tanhongit.png","language":"Ruby","funding_links":["https://www.paypal.me/tanhongcom"],"categories":[],"sub_categories":[],"readme":"# Welcome to Rails 6 Send Mail Backgtound Job with gem sidekiq\n\nThe Rails 6  Send Mail Backgtound Job is a small task for everyone to practice more when programming with Ruby on Rails.\n\nWe will use gem sidekiq to perform this task.\n\n## Support for me\nSupport this project :stuck_out_tongue_winking_eye: :pray:\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.paypal.me/tanhongcom\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-green.svg\" data-origin=\"https://img.shields.io/badge/Donate-PayPal-green.svg\" alt=\"PayPal buymeacoffee TanHongIT\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# 1. Technology\n- Ruby on Rails\n\n# 2. Configuration requirements\nWe are going to build the web application using:\n- Rails 6.0.3.2\n- Ruby 2.7.1\n\n# 4. What is background Job\nSince you already know the call to your Application will be slow, you want it to happen in a background job, so that users can see the confirmation message in their browser immediately without having to wait for the charge to actually happen. To do this, you must create an Active Job class, implement that class to call charge!(), and then add code to the controller to execute this job. The flow looks like the following figure.\n\n![Image](https://imgur.com/Ns3P04e.png)\n\n# 5. Runing\n\n## 5.1. Clone Repo\n\n```\n$ git clone https://github.com/TanHongIT/send_mail_background_job\n$ cd send_mail_background_job\n```\n\n### 5.2. Bundle Install \n\n```\n$ bundle install\n```\n\n### 5.3. Yarn Install \n\n```\n$ yarn install\n```\n\n### 5.4. Create database with Postgresql\n\nYou must change the appropriate database configuration\n\nChange configuration at _\"config/database.yml\"_ with Postgresql.\n\n```ruby\ndefault: \u0026default\n  adapter: postgresql\n  pool: \u003c%= ENV.fetch(\"RAILS_MAX_THREADS\") { 5 } %\u003e\n  timeout: 5000\n  username: send_mail_background_job\n  password: 1234\n  host: localhost\n\n# tutorial for ubuntu linux:\n# sudo -u postgres psql\n# create user \"send_mail_background_job\" with password '1234';  \n# create database \"send_mail_background_job\" owner \"send_mail_background_job\"; \n\ndevelopment:\n  \u003c\u003c: *default\n  database: send_mail_background_job\n\n# Warning: The database defined as \"test\" will be erased and\n# re-generated from your development database when you run \"rake\".\n# Do not set this db to the same as development or production.\ntest:\n  \u003c\u003c: *default\n  database: send_mail_background_job_test\n\nproduction:\n  \u003c\u003c: *default\n  database: send_mail_background_job_production\n```\n\nYou must change the username, password and database name accordingly!\n\n### 5.5. run rails db:migrate\n\n```\n$ rails db:migrate\n```\n\n### 5.6. Change your mail\n\nRun console :\n\n```\n$ bundle exec figaro install\n```\n\nGo to config directory and add to file **\"config/application.yml\"**\n\n```ruby\nuser_mail: 'yourmail@gmail.com'\npassword: 'your password'\n```\n\nChange your mail in **app/mailers/application_mailer.rb** \n\n```ruby\nclass ApplicationMailer \u003c ActionMailer::Base\n  default from: 'your_mail'\n  layout 'mailer'\nend\n```\n\n### 5.7. Run sidekiq\n\n```\n$ bundle exec sidekiq\n```\n\n### 5.8. Run server \n\nOpen new terminal and run:\n\n```\nrails s\n```\n\nNow go to at http://localhost:3000/users/new and put your mail end waiting for a response to arrive\n\n# 6. Demo\n\n![Image](https://imgur.com/xON93Xa.png)\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"https://img.shields.io/packagist/l/doctrine/orm.svg\" data-origin=\"https://img.shields.io/packagist/l/doctrine/orm.svg\" alt=\"license\"\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanhongit%2Fsend_mail_background_job","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanhongit%2Fsend_mail_background_job","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanhongit%2Fsend_mail_background_job/lists"}