Skip to content

Commit

Permalink
add flash message to resend welcome email
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonXu33 committed Feb 23, 2024
1 parent 2ee19ed commit 177c1c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/teachers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions app/views/teachers/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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'>
Expand Down

0 comments on commit 177c1c6

Please sign in to comment.