Class: Gemgento::Magento::Email::Sales::ShipmentsController

Inherits:
BaseController show all
Defined in:
app/controllers/gemgento/magento/email/sales/shipments_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#validate_ip

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/gemgento/magento/email/sales/shipments_controller.rb', line 7

def create
  order = Gemgento::Magento::OrderAdapter.find(params[:data][:order][:increment_id]).import
  shipment = Gemgento::Magento::ShipmentAdapter.find(params[:data][:shipment][:increment_id]).import

  Gemgento::SalesMailer.shipment_email(
      params[:data][:recipients],
      params[:data][:sender],
      order,
      shipment
  ).deliver

  render nothing: true
end