Sha256: ca2381e98d17b6d5d989613339186357c8144f336f2ffd8318d3a4eeeef74785

Contents?: true

Size: 726 Bytes

Versions: 2

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

module MrCommon
  module Registrations
    class ResendNotificationsController < BaseController
      def create
        find_registration
        send_notification
        redirect_to @registration, notice: "Notification sent."
      end

      private

        def find_registration
          @registration = MrCommon::Registration.find(params[:registration_id])
        end

        def send_notification
          if @registration.confirmed?
            MrCommon::RegistrationMailer.confirmed_registration(@registration.id).deliver_now
          else
            MrCommon::RegistrationMailer.unconfirmed_registration(@registration.id).deliver_now
          end
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mr_common-2.1.0 app/controllers/mr_common/registrations/resend_notifications_controller.rb
mr_common-2.0.0 app/controllers/mr_common/registrations/resend_notifications_controller.rb