Skip to content

Instantly share code, notes, and snippets.

class ApplicationMailbox < ActionMailbox::Base
routing ->(inbound_email) { with_sku?(inbound_email) } => :price_finder
def self.with_sku?(inbound_email)
inbound_email.mail.subject.include?('SKU') || inbound_email.mail.body.include?('SKU')
end
end
class PriceFinderMailbox < ApplicationMailbox
class ApplicationMailbox < ActionMailbox::Base
# Any of the recipients of the mail (whether to, cc, bcc) are matched against the regexp.
routing /^replies@/i => :replies
# Any of the recipients of the mail (whether to, cc, bcc) needs to be an exact match for the string.
routing "help@example.com" => :help
# Any inbound_email that has not been already matched will be sent to the BackstopMailbox.
routing :all => :backstop
end
@sanjay-btc
sanjay-btc / gist:c332d6f8a886853d5071f0a08051ff70
Created December 20, 2018 06:23
Install AWS Vault in Ubuntu
sudo curl -L -o /usr/local/bin/aws-vault https://github.com/99designs/aws-vault/releases/download/v4.2.0/aws-vault-linux-amd64
sudo chmod 755 /usr/local/bin/aws-vault