Commit fbedec7d by Thanh Hung Pham

Fix comment - pass param to ApplyMailer.apply_mail method

parent 90635aef
......@@ -38,7 +38,7 @@ class JobsController < ApplicationController
@apply_job = Apply.new(user: current_user, job: @job, applied_at: Time.zone.now)
if @apply_job.save
ApplyMailer.apply_mail(@apply_form.email, @apply_form.fullname, @cv_link, @job).deliver_now
ApplyMailer.apply_mail(@apply_form, @cv_link, @job).deliver_now
flash[:success] = 'Apply success!'
else
flash[:error] = 'Apply error!'
......
class ApplyMailer < ApplicationMailer
default from: 'hungpt@zigexn.vn'
def apply_mail(email, fullname, cv_link, job)
@email = email
@fullname = fullname
def apply_mail(apply_form, cv_link, job)
@email = apply_form.email
@fullname = apply_form.fullname
@cv_link = cv_link
@job = job
mail(to: email, subject: 'Thank you for apply with VeNJOB')
mail(to: @email, subject: 'Thank you for apply with VeNJOB')
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment