Class: Fetcher::Imap::SupportEmails
- Defined in:
- lib/bas/fetcher/imap/use_case/support_emails.rb
Overview
This class is an implementation of the Fetcher::Imap::Base interface, specifically designed for fetching support email from a Google Gmail account.
Constant Summary collapse
- TOKEN_URI =
"https://oauth2.googleapis.com/token"
- EMAIL_DOMAIN =
"imap.gmail.com"
- EMAIL_PORT =
993
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#fetch ⇒ Object
Implements the data fetching filter for support emails from Google Gmail.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Fetcher::Base
Instance Method Details
#fetch ⇒ Object
Implements the data fetching filter for support emails from Google Gmail.
18 19 20 21 22 23 |
# File 'lib/bas/fetcher/imap/use_case/support_emails.rb', line 18 def fetch yesterday = (Time.now - (60 * 60 * 24)).strftime("%e-%b-%Y") query = ["TO", config[:search_email], "SINCE", yesterday] execute(EMAIL_DOMAIN, EMAIL_PORT, TOKEN_URI, query) end |