Class: Decidim::GroupEmailConfirmationsController

Inherits:
ApplicationController show all
Includes:
FormFactory, UserGroups
Defined in:
app/controllers/decidim/group_email_confirmations_controller.rb

Overview

The controller to manage email confirmations for user groups.

Instance Method Summary collapse

Methods included from UserGroups

#enforce_user_groups_enabled

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from TranslatableAttributes

#default_locale?

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#createObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/decidim/group_email_confirmations_controller.rb', line 13

def create
  enforce_permission_to(:manage, :user_group, user_group:)
  if user_group.email.blank?
    flash.keep[:alert] = t("decidim.profiles.user.fill_in_email_to_confirm_it")
    redirect_to(edit_group_path(user_group.nickname)) && return
  end

  user_group.send_confirmation_instructions

  flash.keep[:notice] = t("decidim.profiles.user.confirmation_instructions_sent")
  redirect_back(fallback_location: decidim.profile_path(user_group.nickname))
end