mailers on candidate creation

This commit is contained in:
Mark Moser
2016-08-02 11:48:18 -05:00
parent f626aea47d
commit 54189603f0
2 changed files with 7 additions and 3 deletions

View File

@ -14,6 +14,8 @@ class RecruiterController < ApplicationController
@candidate = Candidate.create(candidate_params.merge(recruiter_id: current_recruiter.id))
if @candidate.persisted?
CandidateMailer.welcome(@candidate).deliver_now
RecruiterMailer.candidate_created(@candidate).deliver_now
redirect_to recruiter_path, flash: { notice: "Sucessfully created candidate #{@candidate.name}" }
else
flash[:error] = "Failed to save Candidate."