lib/spree_sendwithus/message.rb in spree_sendwithus-2.0.11.3 vs lib/spree_sendwithus/message.rb in spree_sendwithus-2.0.11.4
- old
+ new
@@ -1,18 +1,19 @@
require 'send_with_us'
module Spree
module SendWithUs
class Message
- attr_reader :to, :from, :email_id, :email_data, :cc, :bcc
+ attr_reader :to, :from, :email_id, :email_data, :cc, :bcc, :files
def initialize
@email_data = {}
@to = {}
@from = {}
@cc = []
@bcc = []
+ @files = []
end
def assign(key, value)
@email_data.merge!(key.to_sym => value)
end
@@ -34,15 +35,17 @@
@from.merge!(reply_to: value)
when :cc
@cc.concat(value)
when :bcc
@bcc.concat(value)
+ when :files
+ @files.concat(value)
end
end
end
def deliver
- ::SendWithUs::Api.new.send_with(@email_id, @to, @email_data, @from, @cc, @bcc)
+ ::SendWithUs::Api.new.send_with(@email_id, @to, @email_data, @from, @cc, @bcc, @files)
end
end
end
end