def deliver(audience)
      audience = Outbox::Accessor.new(audience)

      each_message_type do |message_type, message|
        next if message.nil?

        recipient = audience[message_type]
        message.deliver(recipient) if recipient
      end
    end
def deliver(audience)
      audience = Outbox::Accessor.new(audience)

      each_message_type do |message_type, message|
        next if message.nil?

        recipient = audience[message_type]
        message.deliver(recipient) if recipient
      end
    end
Delivers all of the messages to the given 'audience'. An 'audience'
 object can be a hash or an object that responds to the current message
 types. Only the message types specified in the 'audience' object will
 be sent to.

   message.deliver email: 'hello@example.com', sms: '+15555555555'
   audience = OpenStruct.new
   audience.email = 'hello@example.com'
   audience.sms = '+15555555555'
   message.deliver(audience)