Class: Members::InvitationReminderEmailService

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/services/members/invitation_reminder_email_service.rb

Constant Summary collapse

MAX_INVITATION_LIFESPAN =
14.0
REMINDER_RATIO =
[2, 5, 10].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(invitation) ⇒ InvitationReminderEmailService

Returns a new instance of InvitationReminderEmailService.


12
13
14
# File 'app/services/members/invitation_reminder_email_service.rb', line 12

def initialize(invitation)
  @invitation = invitation
end

Instance Attribute Details

#invitationObject (readonly)

Returns the value of attribute invitation.


7
8
9
# File 'app/services/members/invitation_reminder_email_service.rb', line 7

def invitation
  @invitation
end

Instance Method Details

#executeObject


16
17
18
19
20
21
# File 'app/services/members/invitation_reminder_email_service.rb', line 16

def execute
  reminder_index = days_on_which_to_send_reminders.index(days_after_invitation_sent)
  return unless reminder_index

  invitation.send_invitation_reminder(reminder_index)
end