Part 1: Removed Emails (Should never send)
- AchievementMailer.earned_achievements
- Trigger the achievement email for a user via rails console:
user = User.last
achievement = Achievement.last
AchievementMailer.earned_achievements(user.id, achievement.id).deliver_now- Expected result: The email should be suppressed and not sent.
- WorkSummaryMailer.me_work_summary & team_work_summary (daily)
- Trigger the daily work summaries for a user and organization:
user = User.last
organization = user.organizations.last
date = Date.current.iso8601
WorkSummaryMailer.me_work_summary(user, organization, date, 'daily').deliver_now
WorkSummaryMailer.team_work_summary(user, organization, date, 'daily').deliver_now- Expected result: Neither email should be sent. (Sanity check: passing
'weekly'instead of'daily'should still send the email).
Part 2: Suppressed Emails (Inactive > 30 days + Experiment ON)
- First, setup the context in your rails console:
organization = Organization.last
# Setup User A (Active - tracked time recently)
active_user = User.find(...) # insert ID of an active user
# Setup User B (Inactive - no time tracked in > 30 days)
inactive_user = User.find(...) # insert ID of an inactive user- AttendanceMailer.management_late_shift_notice
- Trigger the late shift notice for both users:
active_shift = Shift.where(user: active_user).last
inactive_shift = Shift.where(user: inactive_user).last
AttendanceMailer.management_late_shift_notice(active_shift).deliver_now
AttendanceMailer.management_late_shift_notice(inactive_shift).deliver_now- Expected result: Only the email for
active_useris sent.
- AttendanceMailer.management_missed_shift_notice
- Trigger the missed shift notice:
active_shift = Shift.where(user: active_user).last
inactive_shift = Shift.where(user: inactive_user).last
AttendanceMailer.management_missed_shift_notice(active_shift).deliver_now
AttendanceMailer.management_missed_shift_notice(inactive_shift).deliver_now- Expected result: Only the email for
active_useris sent.
- AttendanceMailer.management_abandoned_shift_notice
- Trigger the abandoned shift notice:
active_shift = Shift.where(user: active_user).last
inactive_shift = Shift.where(user: inactive_user).last
AttendanceMailer.management_abandoned_shift_notice(active_shift).deliver_now
AttendanceMailer.management_abandoned_shift_notice(inactive_shift).deliver_now- Expected result: Only the email for
active_useris sent.
- WorkBreakMailer.send_notice
- Trigger the work break management notice:
active_break = WorkBreak.where(user: active_user).last
inactive_break = WorkBreak.where(user: inactive_user).last
WorkBreakMailer.send_notice(active_break).deliver_now
WorkBreakMailer.send_notice(inactive_break).deliver_now- Expected result: Only the email for
active_useris sent.