GithubHelp home page GithubHelp logo

draym / mymailapp Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 37 KB

Mail SAAS which offers mailing managing APIs. Useful for backend-less websites which require sending e-mails.

License: Boost Software License 1.0

Java 100.00%
saas mail-server mail-api

mymailapp's Introduction

My Mail App ๐Ÿ“ง

Mail application for backend-less websites.

You can register your websites and obtain an api_key, then use the MyMail api to send emails. For now the administrative tools are only available throught API call, an Admin UI panel will surely be done in future once i find the time to do so.

The application is fully open to use & modification, simply clone it and follow the next steps to install it on your own server.



How to Install :

  1. clone the project locally or directly on your server (be sure to have java & maven installed)

For the next steps you may want to update the default properties

LOCAL: in src/main/ressources/application.properties

PROD: I advise you to create a new file src/main/ressources/application-prod.properties and override the DB identifiers in case you want to push your application publicly on git

  1. create a database, by default the name should be 'my_mail_app' and use MySql

    • you can modify the name and the database type
    • Local: for MySql, you can download Wamp to host your DB
    • Server: you need to install MySql or other
  2. create your smtp properties in src/main/ressources/smtp_mail.properties
    exemple:

    // smtp config
    mail.smtp.auth=true
    mail.smtp.starttls.enable=true
    mail.smtp.host=smtp.gmail.com
    mail.smtp.port=587
    // fromName
    from='your-email'@gmail.com
    // identifier
    username='your-email'@gmail.com
    password='your-password'

  3. Run it:

    • Locally by using SpringBoot
    • PROD by creating a jar or war using Maven 'mvn clean package -Pprod'
  4. Deploy it on your favorite tool, i personally use Nginx on Ubuntu

  5. your API should now be live



How to Use :

Please check out the API documentation at the bottom of the page.

Use curl on Linux or any tools in Windows like Postman to setup MyMail.


The default path to setup the mails on your website should be as follow :

  1. Register a website using /api/app/register

  2. You will get an object containing an apiKey -> save it somewhere

  3. In your website code : save the apiKey in the env variables or as a static somewhere in your Javascript

  4. When your website needs to send an email use

    • packup the apiKey in the Http request Header with key 'ApiKey'.
    • to send to someone : /api/email/send
    • to send to yourself (contact page) : /api/email/toAdmin


API Documentation :

  1. /api/admin

    PUT: /api/admin/app/update
    ---> update an application configuration, name can't be modified
    parameters = {
      "baseUrl": String,
      "desccription": String,
    "descUrl": String
    }
    return = Application object
    PUT: /api/admin/app/delete
    ---> delete an application
    url parameters: Long id
    GET: /api/admin/app/get
    ---> get an application
    url parameters: String name, String url (baseUrl)
    return: Application object
    GET: /api/admin/app/getAll
    ---> get all application
    parameters: none
    return: Applications array
    PUT: /api/admin/key/deactivate
    ---> deactivate an API_Key
    url parameters: Long id
    PUT: /api/admin/key/deactivateByKey
    ---> deactivate an API_Key
    url parameters: String key
    GET: /api/admin/key/get
    ---> get an API_Key
    url parameters: Long id
    return: ApplicationKey object
    GET: /api/admin/key/getAll
    ---> get all API_Keys
    parameters: none
    return: ApplicationKeys array

  1. /api/app

    POST: /api/app/register
    parameters = {
      "name": "my-website", // unique website identifier for a baseUrl
      "baseUrl": "my-website-url.com",  // to verify origin associated to api_key
      "desccription": "Personal website - my description", // opt
    "descUrl": "github.com/my-website" // opt
    }
    return = {
    "apiKey": "123-789-ddd-ccc",
    "active": true
    }

  1. /api/email

    POST: /api/email/send
    ---> use to send an email to a user
    parameters = {
      "name": String, // user name ex:contact page
      "email": String,
      "subject": String,
    "message": String,
    }
    return = true/false
    POST: /api/email/toAdmin
    ---> use to receive an email from a user (ex: contact page)
    {
      "name": String, // user name ex:contact page
      "email": String,
      "subject": String,
    "message": String
    }
    return = true/false

mymailapp's People

Contributors

dependabot[bot] avatar draym avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.