Skip to content

Latest commit

 

History

54 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yardsourcing Sendgrid Microservice

The Yardsourcing SendGrid Microservice is a lightweight modular service that consumes SendGrid's email API. It can be hooked into your existing application to send email communications to your users.

This app is currently being used by our backend engine for Yardsourcing, a web application that connects hosts with users looking to rent a yard. The Yardsourcing app is built with service oriented architecture using this Microservice for email (see Project Architecture). It exposes a single API endpoint that triggers an email request.

Related Repos

To explore the full web application, please visit the built out front end application that hooks into this engine and its endpoints.

To set up automatic email confirmation, please visit the Sendgrid microservice.

Created by:

Built With

This project was tested with:

  • RSpec version 3.10

Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  • Ruby

    • The project is built with ruby using ruby version 2.5.3p105, you must install ruby on your local machine first. Please visit the ruby home page to get set up. Please ensure you install the version of ruby noted above.
  • Sendgrid-Ruby Gem

    • This gem is included in the Gemfile and will be installed with the repo. However, it is used for the Sendgrid API communication. Please reference their documentation for how this gem interacts with Sendgrid.

Installing

  1. Clone the repo
$ git clone https://github.com/Yardsourcing/yardsourcing-sendgrid
  1. Bundle Install
$ bundle install
  1. Start sinatra ruby server
$ bundle exec ruby applicationcontroller.rb
  1. Set up Environment Variables
    • run bundle exec figaro install
    • add the below variables to the config/application.yml
      SENDGRID_API_KEY:'<YOU_SENDGRID_API_KEY>'
    

Endpoints

Mail
  • POST request to send email
    • required params:
      • to=<recipient_email>
      • from=<sender_email>
      • subject=<email_subject>
      • content=<email_body>
    • examples:
      • post http://localhost:4567/mail?to=email@gmail.com&from=myemail@hotmail.com&subject=BDAY BASH&content=You are Invited!

Project Architecture

Testing

Running Tests
  • To run the full test suite run the below in your terminal:
$ bundle exec rspec

How to Contribute

In the spirit of collaboration, things done together are better than done on our own. If you have any amazing ideas or contributions on how we can improve this API they are greatly appreciated. To contribute:

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Roadmap

See the open issues for a list of proposed features (and known issues). Please open an issue ticket if you see an existing error or bug.

Contributors

Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages