Method: Fluent::SESOutput#start

Defined in:
lib/fluent/plugin/out_ses.rb

#startObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fluent/plugin/out_ses.rb', line 29

def start
  super
  options = {}
  if @aws_key_id && @aws_sec_key
    options[:access_key_id]     = @aws_key_id
    options[:secret_access_key] = @aws_sec_key
  end
  @ses = AWS::SimpleEmailService.new options

  to_addresses  = @to.split ","
  if to_addresses.empty?
    raise Fluent::ConfigError, "To is not nil."
  end

  cc_addresses  = @cc.split ","
  bcc_addresses = @bcc.split ","

  @destination = {:to_addresses => to_addresses}
  unless cc_addresses.empty?
    @destination[:cc_addresses] = cc_addresses
  end
  unless bcc_addresses.empty?
    @destination[:bcc_addresses] = bcc_addresses
  end
  valid!
end