Sha256: cf57e3e78f8ec3521dfe2ce3fb467d6a215ed5e1e3eeaea94b4a603a7192bef4

Contents?: true

Size: 736 Bytes

Versions: 5

Compression:

Stored size: 736 Bytes

Contents

module Senders
  class Email
    def self.send_messages(messages)
      messages.each do |message|
        Mail.deliver do
          from Config.option(:smtp, :from_email)
          to Config.option(:smtp, :to_email)
          subject "New Facebook message on chat #{message.message_thread}"
          body message.text
        end
      end
    end

    def self.send_error(error, screenshot: nil)
      Mail.deliver do
        from Config.option(:smtp, :from_email)
        to Config.option(:smtp, :to_email)
        subject 'Error occurred during Fuck Facebook command'
        body error.full_message(highlight: false)
        add_file filename: 'error_screenshot.png', content: screenshot if screenshot
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fuck_facebook-0.5.4 src/senders/email.rb
fuck_facebook-0.5.3 src/senders/email.rb
fuck_facebook-0.5.2 src/senders/email.rb
fuck_facebook-0.5.1 src/senders/email.rb
fuck_facebook-0.5.0 src/senders/email.rb