Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Commit

Permalink
Send applicant emails on updates
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Apr 15, 2014
1 parent 3f0cc05 commit f4bc39d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/controllers/applicants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ def edit
# PATCH/PUT /applicants/1
def update
if @applicant.update(applicant_params)
redirect_to @applicant, notice: params
begin
@applicant.send_emails
rescue Errno::ECONNREFUSED
redirect_to @applicant,
notice: 'Your application was updated but the emails failed to send. Save this URL and contact the ASC for assistance'
else
redirect_to @applicant, notice: 'Your application was saved succesfully'
end
else
render action: 'edit'
end
Expand Down

0 comments on commit f4bc39d

Please sign in to comment.