mailers on candidate creation
This commit is contained in:
@ -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."
|
||||
|
Reference in New Issue
Block a user