Module: Emails::Groups

Includes:
Namespaces::DeletableHelper
Included in:
Notify
Defined in:
app/mailers/emails/groups.rb

Instance Method Summary collapse

Methods included from Namespaces::DeletableHelper

#_additional_removed_items, #_deletion_scheduled_in_hierarchy_chain_message, #_message_for_namespace, #_parent_deletion_scheduled_message, #_permanently_delete_group_message, #_project_delete_button_shared_data, #_remove_group_warning, #_self_deletion_in_progress_message, #_self_deletion_scheduled_message, #confirm_remove_group_message, #delete_delayed_namespace_message, #delete_immediately_namespace_scheduled_for_deletion_message, #deletion_in_progress_or_scheduled_in_hierarchy_chain?, #group_confirm_modal_data, #permanent_deletion_date_formatted, #project_delete_delayed_button_data, #project_delete_immediately_button_data, #restore_namespace_path, #restore_namespace_scheduled_for_deletion_message, #restore_namespace_title, #self_or_ancestors_deletion_in_progress_or_scheduled_message

Instance Method Details

#group_email(current_user, group, subj, errors: nil) ⇒ Object



15
16
17
18
19
# File 'app/mailers/emails/groups.rb', line 15

def group_email(current_user, group, subj, errors: nil)
  @group = group
  @errors = errors
  mail_with_locale(to: current_user.notification_email_for(@group), subject: subject(subj))
end

#group_scheduled_for_deletion(recipient_id, group_id) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'app/mailers/emails/groups.rb', line 21

def group_scheduled_for_deletion(recipient_id, group_id)
  @group = ::Group.find(group_id)
  @user = ::User.find(recipient_id)
  @deletion_due_in_days = ::Gitlab::CurrentSettings.deletion_adjourned_period.days
  @deletion_date = permanent_deletion_date_formatted(@group, format: '%B %-d, %Y')

  email_with_layout(
    to: @user.email,
    subject: subject('Group scheduled for deletion')
  )
end

#group_was_exported_email(current_user, group) ⇒ Object



7
8
9
# File 'app/mailers/emails/groups.rb', line 7

def group_was_exported_email(current_user, group)
  group_email(current_user, group, _('Group was exported'))
end

#group_was_not_exported_email(current_user, group, errors) ⇒ Object



11
12
13
# File 'app/mailers/emails/groups.rb', line 11

def group_was_not_exported_email(current_user, group, errors)
  group_email(current_user, group, _('Group export error'), errors: errors)
end