Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postman_mta

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postman_mta

  • 0.2.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Postman MTA

Build Status Code Climate Gem Version

Rails gem to easy integrate Postman to your application

This gem will add some routes to the application to forward requests from frontend to postman API

Installation

Add this line to your application's Gemfile:

gem 'postman_mta'

And then execute:

$ bundle

Or install it yourself as:

$ gem install postman_mta

Usage

Mount engine in config/routes.rb:

mount PostmanMta::Engine => '/mta'

Then configure the gem:

# config/initializers/postman_mta.rb
PostmanMta.setup do |config|
  config.api_key = ENV['POSTMAN_API_KEY']
  config.api_secret = ENV['POSTMAN_API_SECRET']
  config.api_endpoint = ENV['POSTMAN_API_ENDPOINT']
end

This will add the following routes:

Routes for PostmanMta::Engine:
           messages POST   /messages(.:format)                                  postman_mta/messages#create
            message GET    /messages/:id(.:format)                              postman_mta/messages#show
conversation_labels POST   /conversations/:conversation_id/labels(.:format)     postman_mta/labels#create
 conversation_label DELETE /conversations/:conversation_id/labels/:id(.:format) postman_mta/labels#destroy
  conversation_tags POST   /conversations/:conversation_id/tags(.:format)       postman_mta/tags#create
   conversation_tag DELETE /conversations/:conversation_id/tags/:id(.:format)   postman_mta/tags#destroy
      conversations GET    /conversations(.:format)                             postman_mta/conversations#index
       conversation GET    /conversations/:id(.:format)                         postman_mta/conversations#show

for messages#create the following parameters accepted:

    attribute :from, String
    attribute :to, Array # The array of recepient email addresses
    attribute :plain_body, String
    attribute :html_body, String
    attribute :bcc, Array # The array of bcc email addresses
    attribute :cc, Array # The array of cc email addresses
    attribute :reply_to, String
    attribute :in_reply_to, String
    attribute :subject, String
    attribute :attachments, Array # [{ base64: "YXNmYXNmYXNm\n", name: 'file.txt', content_type: 'text/plain' }]

Messages are grouped in conversations. Conversations can be accessed using corresponding #index and #show actions.

Filter parameters for conversations#index:

    { tag_title: 'some_tag', tag_value: 'some_value' }
    { label: 'some_label_title' }

Conversations can be tagged and/or labeled. Labels and tags can be used for search. To create new tag for conversation, send the following params to tags#create:

    attribute :title, String
    attribute :value, String
    attribute :conversation_id, Integer

Params for label:

    attribute :title, String
    attribute :sort_order, Integer
    attribute :color, String

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/psyipm/postman_mta.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 31 Aug 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc