mail: Include shipment details in the shipping method

Allow to explain the shipping method. This is used in the shippment
mail. E.g. one can explain the registered mail and the options.
This commit is contained in:
Holger Hans Peter Freyther 2012-08-01 13:16:51 +02:00
parent 005e686187
commit a755c72f35
4 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<%= f.field_container :details do %>
<%= f.label :details, t("details") %><br />
<%= f.text_area :method_details %>
<%= error_message_on :shipping_method, :method_details %>
<% end %>

View File

@ -0,0 +1 @@
<%= @shipment.shipping_method.method_details %>

View File

@ -0,0 +1,9 @@
class DhlShippingDetails < ActiveRecord::Migration
def self.up
add_column :shipping_methods, :method_details, :string
end
def self.down
remove_column :shipping_methods, :method_details
end
end

View File

@ -6,4 +6,8 @@ class SysmocomDhlHooks < Spree::ThemeSupport::HookListener
# Add the DHL label download
insert_after :admin_shipment_edit_buttons, 'admin/dhls/address_label'
# Add shipment identification..
insert_after :shipment_mailer_shipped_email_tracking, 'shipment_mailer/dhls/tracking_description'
insert_after :admin_shipping_method_form_fields, 'admin/dhls/method_details_form'
end