
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Outbox is a factory for creating notifications in a variety of protocols, including: email, SMS, and push notifications. Each protocol is built as a generic interface where the actual delivery method or service can be configured independently of the message itself.
Add this line to your application's Gemfile:
gem 'outbox'
And then execute:
$ bundle
Or install it yourself as:
$ gem install outbox
This gem is still in early development with plans to support email, SMS, and push notificaitons. As protocols and services are added, this support table will be updated:
Service | Alias | Client | Gem |
---|---|---|---|
Mail gem | :mail | Outbox::Clients::MailClient | Included |
Service | Alias | Client | Gem |
---|---|---|---|
Twilio | :twilio | Outbox::Twilio::Client | outbox-twilio |
TODO…
Outbox is inspired by Mail's syntax for creating emails.
An Outbox message is actually a factory for creating many different types of messages with the same topic. For example: a topic could be an event reminder in a calendar application. You want to send out essentially the same content (the reminder) as an email, SMS, and/or push notifications depending on user preferences:
message = Outbox::Message.new do
email do
from 'noreply@myapp.com'
subject 'You have an upcoming event!'
end
sms do
from '+15557654321'
end
ios_push do
badge '+1'
sound 'default'
end
body "Don't forget, you have an upcoming event on 8/15/2013."
end
# This will deliver the message to User's given contact points.
message.deliver(
email: 'user@gmail.com',
sms: '+15551234567',
ios_push: 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660'
)
Making just an email is done just how you would using the Mail gem, so look there for in-depth examples. Here's a simple one to get you started:
email = Outbox::Messages::Email.new do
to 'user@gmail.com'
from 'noreply@myapp.com'
subject 'You have an upcoming event!'
text_part do
body "Don't forget, you have an upcoming event on 8/15/2013."
end
html_part do
body "<h1>Event Reminder</h1>..."
end
end
# Configure the client. If you use the MailClient, you can specify
# the actual delivery method:
email.client :mail, delivery_method: :smtp, smtp_settings: {}
# And deliver using the specified client
email.deliver
Configuration can be done in two ways:
mail_client = Outbox::Clients::MailClient.new(
delivery_method: :smtp,
smtp_settings: {}
)
sms_client = Outbox::Twilio::Client.new(
account_sid: 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
auth_token: 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
)
message = Outbox::Message.new do
email do
client(mail_client)
# content...
end
sms do
client(sms_client)
# content...
end
end
Outbox::Messages::Email.default_client(
:mail,
delivery_method: :smtp,
smtp_settings: {}
)
Outbox::Messages::SMS.default_client(
:twilio,
account_sid: 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
auth_token: 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
)
message = Outbox::Message.new do
email do
# content...
end
sms do
# content...
end
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that outbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.