diff --git a/app/controllers/teachers_controller.rb b/app/controllers/teachers_controller.rb index cbcf35ba..a011837d 100644 --- a/app/controllers/teachers_controller.rb +++ b/app/controllers/teachers_controller.rb @@ -160,7 +160,12 @@ def destroy def resend_welcome_email if @teacher.validated? || @is_admin TeacherMailer.welcome_email(@teacher).deliver_now + flash[:success] = "Welcome Email resent successfully!" + else + flash[:alert] = "Error resending Welcome Email. \ + Please make sure that you are signed in and validated." end + redirect_to edit_teacher_path(@teacher) end def import diff --git a/app/views/teachers/show.html.erb b/app/views/teachers/show.html.erb index 2159dbab..14a8eeb5 100644 --- a/app/views/teachers/show.html.erb +++ b/app/views/teachers/show.html.erb @@ -2,6 +2,12 @@ <%= render 'teacher_info', teacher: @teacher %> +<% if flash[:notice].present? %> + <div class="flash notice"> + <%= flash[:notice] %> + </div> +<% end %> + <hr> <div class='row'> <div class='col-12'>