Commit 37e1a7ba by Thanh Hung Pham

Send mail apply complete

parent abd34948
......@@ -10,19 +10,21 @@ class JobsController < ApplicationController
end
def apply
@job_id = params[:job_id]
end
def confirm
@fullname = params['fullname']
@email = params['email']
@fullname = params[:fullname]
@email = params[:email]
@job_id = params[:job_id]
end
def done
@email = params[:email]
@fullname = params[:fullname]
@cv_link = 'link to download'
ApplyMailer.apply_mail(@email, @fullname, @cv_link).deliver
@job = Job.find(params[:job_id])
ApplyMailer.apply_mail(@email, @fullname, @cv_link, @job).deliver
end
def show
......
class ApplyMailer < ApplicationMailer
default from: 'hungpt@zigexn.vn'
def apply_mail(email, fullname, cv_link)
def apply_mail(email, fullname, cv_link, job)
@email = email
@fullname = fullname
@cv_link = cv_link
@job = job
mail(to: email, subject: 'Thank you for apply with VeNJOB')
end
end
......@@ -6,14 +6,14 @@
<body>
<p> Dear <%= @fullname %></p>
<p> Thank you for applied with VenJOB. Your applied job's information is as follow: </p>
<p> Job title: <Job title> </p>
<p> Location: <Job location> </p>
<p> Company: <Company> </p>
<p> Job title: <%= @job.name %> </p>
<p> Location: <%= @job.city.name unless @job.city.nil? %> </p>
<p> Company: <%= @job.company.name unless @job.company.nil? %> </p>
<p> Your submitted information: </p>
<p> Full Name: <%= @fullname %> </p>
<p> Email: <%= @email %></p>
<p> CV Link: <%= @cv_link %></p>
<p> Email: <%= @email %> </p>
<p> CV Link: <%= @cv_link %> </p>
<p> Best, </p>
</body>
......
Hello
Dear <%= @fullname %>
Thank you for applied with VenJOB. Your applied job's information is as follow:
Job title: <%= @job.name %>
Location: <%= @job.city.name unless @job.city.nil? %>
Company: <%= @job.company.name unless @job.company.nil? %>
Your submitted information:
Full Name: <%= @fullname %>
Email: <%= @email %>
CV Link: <%= @cv_link %>
Best,
......@@ -13,6 +13,7 @@
<div class="form-group">
<label>Full name</label><br />
<%= text_field_tag 'fullname', current_user.fullname, class: 'form-control' %>
<%= hidden_field_tag 'job_id', @job_id %>
</div>
<div class="form-group">
<label>Email</label><br />
......
......@@ -13,6 +13,7 @@
<div class="form-group">
<label>Full name</label><br />
<%= text_field_tag 'fullname', @fullname, class: 'form-control', readonly: true %>
<%= hidden_field_tag 'job_id', @job_id %>
</div>
<div class="form-group">
<label>Email</label><br />
......
......@@ -18,7 +18,7 @@
</div>
<div class="col-md-2">
<%- if user_signed_in? -%>
<%= link_to 'Apply', jobs_apply_path, class: 'btn btn-primary' %>
<%= link_to 'Apply', jobs_apply_path(job_id: @job.id), class: 'btn btn-primary' %>
<%- else -%>
<%= link_to 'Apply', new_user_session_path, class: 'btn btn-primary' %>
<%- end -%>
......@@ -27,7 +27,7 @@
<div class="row">
<div class="col-md-offset-3 ">
<%- if user_signed_in? -%>
<%= link_to 'Apply', jobs_apply_path, class: 'btn btn-primary' %>
<%= link_to 'Apply', jobs_apply_path(job_id: @job.id), class: 'btn btn-primary' %>
<%- else -%>
<%= link_to 'Apply', new_user_session_path, class: 'btn btn-primary' %>
<%- 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