Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Weekly email reminder for Missing time Entries#496

Merged
supriya3105 merged 10 commits intodevelopfrom
feature/weekly-email-reminder
Jun 22, 2022
Merged

Weekly email reminder for Missing time Entries#496
supriya3105 merged 10 commits intodevelopfrom
feature/weekly-email-reminder

Conversation

@harshaanNihal
Copy link
Contributor

Notion card

https://www.notion.so/saeloun/Send-Reminder-to-employees-to-fill-their-timesheets-on-Monday-if-the-weekly-total-is-less-than-40-ho-6a479e56dc2a45798ef0b7889e382403

Summary

  • Added Weekly scheduled jobs to send emails to users who have less than 40. hours logged for an individual company.
  • Added feature flag to turn off the functionality by removing the value of environment variable ENABLE_WEEKLY_REMINDER [Any jobs which are already scheduled will still get triggered]

Preview

Screenshot from 2022-06-20 11-11-08

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested manually to check if the Target users are correct by scheduling it to hourly instead of weekly.

Checklist:

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have added automated tests for my code

@github-actions
Copy link

github-actions bot commented Jun 20, 2022

Current Code Coverage Percent of this PR:

88.55 %

Files having coverage below 100%

Impacted Files Coverage
/lib/custom_failure.rb 80.0 %
/app/services/weekly_reminder_for_missed_entries_service.rb 31.82 %
/app/controllers/users/invitations_controller.rb 86.36 %
/app/controllers/users/sessions_controller.rb 85.71 %
/app/services/invoice_payment/pdf_generation.rb 70.97 %
/app/services/invoice_payment/checkout.rb 44.0 %
/app/controllers/internal_api/v1/payment_settings_controller.rb 93.33 %
/app/controllers/internal_api/v1/profile_controller.rb 96.88 %
/app/controllers/internal_api/v1/companies_controller.rb 95.45 %
/app/controllers/internal_api/v1/payments/providers_controller.rb 94.74 %
/app/controllers/internal_api/v1/wise/recipients_controller.rb 90.0 %
/lib/benchmarking/benchmarker.rb 0.0 %

@harshaanNihal harshaanNihal added the enhancement New feature or request label Jun 20, 2022
@supriya3105 supriya3105 requested a review from apoorv1316 June 20, 2022 08:44
@supriya3105
Copy link
Contributor

@apoorv1316 Please test this PR.

Copy link
Collaborator

@apoorv1316 apoorv1316 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀🚀🚀

Copy link
Member

@akhilgkrishnan akhilgkrishnan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshaanNihal Added couple of comments

  - Add mailer service with rough email template in html and text format
 - Add the gem sidekiq-scheduler
 - setup a schedule in sidekiq.yml
 - create a job to get triggered by scheduler
 - Send mail to all users who has less than 40 hours for a company.
 - add a string value to turn on the weekly reminder
@harshaanNihal harshaanNihal force-pushed the feature/weekly-email-reminder branch from 8218c6e to 9b45f6f Compare June 21, 2022 08:14
@supriya3105
Copy link
Contributor

@akhilgkrishnan @rohitjoshixyz Please review and add your feedbacks if any

Copy link
Contributor

@rohitjoshixyz rohitjoshixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about the ENV variable name. Rest LGTM


class WeeklyReminderToUserJob < ApplicationJob
def perform(*args)
if ENV["RAILS_LOG_TO_STDOUT"].present?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be ENABLE_WEEKLY_REMINDER

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely missed this one will. Fixed in #514

start_date:,
end_date:,
company_name:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra newline

@supriya3105
Copy link
Contributor

@rohitjoshixyz Created new notion card for your feedback. @harshaanNihal merging this. Please implement the feedback in new PR.

@supriya3105 supriya3105 merged commit 596228b into develop Jun 22, 2022
@supriya3105 supriya3105 deleted the feature/weekly-email-reminder branch June 22, 2022 06:37
@pr-triage pr-triage bot added the PR: merged label Jun 22, 2022
@harshaanNihal harshaanNihal mentioned this pull request Jun 22, 2022
7 tasks
vipulnsward pushed a commit that referenced this pull request Feb 15, 2026
* Add mailer service and email template
  - Add mailer service with rough email template in html and text format

* Add Specs and Preview for Mailer

* Setup Sidekiq-scheduler
 - Add the gem sidekiq-scheduler
 - setup a schedule in sidekiq.yml
 - create a job to get triggered by scheduler

* Add weekly_reminder_service to trigger mailer
 - Send mail to all users who has less than 40 hours for a company.

* Update a Mailer Template and add preview

* Add feature flag for weekly reminder
 - add a string value to turn on the weekly reminder

* Add timezone and fix failing spec

* fix cron

* Fix review comments

* Update email templates folder to views/mailers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants