diff --git a/app/controllers/property_hires_controller.rb b/app/controllers/property_hires_controller.rb
index 66562ee..53ac132 100644
--- a/app/controllers/property_hires_controller.rb
+++ b/app/controllers/property_hires_controller.rb
@@ -169,7 +169,7 @@ class PropertyHiresController < ApplicationController
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue []
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
email << hire.hiring_person_email
- HireMethod.send_mail('p_hire',email,property.id)
+ HireMethod.send_mail('p_hire',email,property.id,nil,hire.id)
end
redirect_to params[:url]
else
diff --git a/app/helpers/admin/property_hires_helper.rb b/app/helpers/admin/property_hires_helper.rb
index 56aac5a..290d2d8 100644
--- a/app/helpers/admin/property_hires_helper.rb
+++ b/app/helpers/admin/property_hires_helper.rb
@@ -63,7 +63,7 @@ module Admin::PropertyHiresHelper
a = multiple_lang_tag(key_field,markup,"#{key_index}][#{field}",field_sets,custom_options,end_block,{},markup=='text_area')
a.html_safe
end
- def self.send_mail(field_name,email,property_id,send_date=nil)
+ def self.send_mail(field_name,email,property_id,send_date=nil,hire_id=nil)
property = Property.where(id: property_id).first
if !property.nil?
email_set = property.hire_email_sets.select{|v| v.field_name == field_name}
@@ -76,14 +76,14 @@ module Admin::PropertyHiresHelper
template:"email/#{field_name}_email.html.erb",
mail_sentdate: send_date || Time.current,
mail_subject: t("seminar.email_#{field_name}_success"),
- template_data:{'property_id'=>property_id,'content'=>content,'locale'=>I18n.locale.to_s})
+ template_data:{'property_id'=>property_id,'content'=>content,'locale'=>I18n.locale.to_s,'hire_id'=>hire_id})
elsif !(email_set[0].disabled)
mail = Email.create(mail_to: Array(email),
module_app_key:"property_hire",
template:"email/#{field_name}_email.html.erb",
mail_sentdate: send_date || Time.current,
mail_subject: email_set[0].title[I18n.locale],
- template_data:{'property_id'=>property_id,'email_set_content'=>email_set[0].content.to_yaml,'content'=>content,'locale'=>I18n.locale.to_s})
+ template_data:{'property_id'=>property_id,'email_set_content'=>email_set[0].content.to_yaml,'content'=>content,'locale'=>I18n.locale.to_s,'hire_id'=>hire_id})
end
begin
mail.deliver
diff --git a/app/views/email/p_hire_email.html.erb b/app/views/email/p_hire_email.html.erb
index add488e..708af9b 100644
--- a/app/views/email/p_hire_email.html.erb
+++ b/app/views/email/p_hire_email.html.erb
@@ -5,4 +5,43 @@
<% end %>
<% else %>
<%= t('property_hire.email_p_hire_content') %>
+<% end %>
+
+<% I18n.with_locale(@data['locale']) do %>
+ <% if !@data['hire_id'].nil? %>
+ <% hire = PHire.where(id: @data['hire_id']).first %>
+
+ | + |
+ <%= t("property_hire.#{k}") %>: + | ++ <% if ['start_time','end_time','recurring','recurring_interval','recurring_end_date','passed'].exclude?(k) %> + <%= v.to_s %> + <% elsif ['start_time','end_time','recurring_end_date'].include?(k) %> + <%= v.strftime('%Y/%m/%d %H:%M') rescue nil %> + <% elsif k == 'recurring_interval' %> + <%= t("property_hire.recurring_interval_types.#{v}") %> + <% elsif 'recurring' == k %> + <%= v ? t('property_hire.yes') : t('property_hire.no') %> + <% else %> + <%= v ? t('property_hire.yes') : t('property_hire.wait_for_permit') %> + <% end %> + | +