Sha256: c0eb395c09488a058c60beffa3574937a55a2600aca4968ca3b63c455392f7d3

Contents?: true

Size: 567 Bytes

Versions: 48

Compression:

Stored size: 567 Bytes

Contents

module Wbase
  class MailEventBatch
    def initialize(params)
      @params = params
    end

    def save
      @params["_json"].each do |ev|
        ev.permit!
        Wbase::MailEvent.create(
          email: ev[:email],
          sg_message_id: ev[:sg_message_id],
          timestamp: ev[:timestamp],
          smtp_id: ev['smtp-id'],
          event: ev[:event],
          mail_eventable_id: ev.fetch(:mail_eventable_id, nil),
          mail_eventable_type: ev.fetch(:mail_eventable_type, nil),
          data: ev.to_json
        )
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
wbase-0.3.20 app/services/wbase/mail_event_batch.rb
wbase-0.3.19 app/services/wbase/mail_event_batch.rb
wbase-0.3.18 app/services/wbase/mail_event_batch.rb
wbase-0.3.17 app/services/wbase/mail_event_batch.rb
wbase-0.3.16 app/services/wbase/mail_event_batch.rb
wbase-0.3.15 app/services/wbase/mail_event_batch.rb
wbase-0.3.14 app/services/wbase/mail_event_batch.rb
wbase-0.3.13 app/services/wbase/mail_event_batch.rb
wbase-0.3.12 app/services/wbase/mail_event_batch.rb
wbase-0.3.11 app/services/wbase/mail_event_batch.rb
wbase-0.3.10 app/services/wbase/mail_event_batch.rb
wbase-0.3.9 app/services/wbase/mail_event_batch.rb
wbase-0.3.8 app/services/wbase/mail_event_batch.rb
wbase-0.3.7 app/services/wbase/mail_event_batch.rb
wbase-0.3.6 app/services/wbase/mail_event_batch.rb
wbase-0.3.5 app/services/wbase/mail_event_batch.rb
wbase-0.3.4 app/services/wbase/mail_event_batch.rb
wbase-0.3.3 app/services/wbase/mail_event_batch.rb
wbase-0.3.2 app/services/wbase/mail_event_batch.rb
wbase-0.3.1 app/services/wbase/mail_event_batch.rb