GithubHelp home page GithubHelp logo

henomis / mailqueue-go Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 139 KB

Simple SMTP client with HTTP/API interface and MongoDB as queue.

License: MIT License

Dockerfile 0.99% Makefile 0.30% Go 98.71%

mailqueue-go's Introduction

๐Ÿ“ค Mailqueue-go

Build Status GoDoc Go Report Card GitHub release

General purpose email queue with REST API interface.

Features

  • ๐Ÿ“Ž Full attachment support (via base64 encoding or filesystem)
  • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Full suppor to Cc, Bcc, reply-to fields
  • ๐ŸŒ HTML template engine
  • ๐Ÿ”’ Automatic TLS support
  • โœ‰๏ธ SMTP client limiter

Build

Use Makefile to build bin/mailqueue-go-api and bin/mailqueue-go-watcher.

make

Docker

You can start a complete mailqueue-go stack with docker-compose.

docker-compose up

Env

Put this in your .env file and modify it to your needs.

MONGO_ENDPOINT=mongodb://admin:pass@mongodb:27017
MONGO_DB=test
MONGO_LOG_DB_SIZE=1000000
MONGO_EMAIL_DB_SIZE=1000000
MONGO_TIMEOUT=10
BIND_ADDRESS=:8080
SMTP_ALLOW=10
SMTP_INTERVAL_MINUTE=1
SMTP_SERVER=localhost
SMTP_USERNAME=username@localhost
SMTP_PASSWORD=password
SMTP_FROM=username@localhost
SMTP_FROMNAME=fromname
SMTP_REPLYTO=noreply@localhost
SMTP_ATTEMPTS=3
LOG_OUTPUT=stdout

API

API endpoint prefix is /api/v1.

Method Route Description
GET /logs Get all logs
GET /logs/{email_id} Get logs for email with id {email_id}
GET /emails Get all emails
GET /emails/{id} Get email with id {id}
POST /emails Enqueue new email
GET /templates Get all templates
GET /templates/{id} Get template with id {id}
PUT /templates/{id} Update template with id {id}
POST /templates Create new template
DELETE /templates/{id} Delete template with id {id}
GET /images/mail/{service}/{id} Tracking open email

Please refer to this directory for examples.

mailqueue-go's People

Contributors

henomis avatar

Stargazers

Jimmy Nelle avatar Xiaodong Chen avatar

Watchers

 avatar

mailqueue-go's Issues

Add SetStatus to watcvhablequeue

Is your feature request related to a problem? Please describe.
watchablequeue should implement SetStatus

Describe the solution you'd like
Add SetStatus method to watchablequeue interface and its mongo implementation

Switch to watchablequeue

Is your feature request related to a problem? Please describe.
mailqueue-go should use watchablequeue

Describe the solution you'd like
Change all the methods where generic queue is used

Tasks

  • change methods to use watchablequeue
  • remove genericqueue

Refactor render

Is your feature request related to a problem? Please describe.
Render should be moved outside queue to adhere to SOLID principles.

Describe the solution you'd like
Refactor Render to be used independently from queue
request here.

Refactor trace in auditlog

Is your feature request related to a problem? Please describe.
Tracer is bad name for this package and it should be moved in internal/pkg/auditlog

Describe the solution you'd like
Refactor Tracer and move to right position

Tasks

  • Refactor Tracer #19
  • Change Trace in Log #20
  • Switch to auditlog #21

Add Get method to watchablequeue

Is your feature request related to a problem? Please describe.
watchablequeue should be able to retreive an element

Describe the solution you'd like
Add Get method to watchablequeue

Manage WatchableQueue ID

Is your feature request related to a problem? Please describe.
Apps that use watchablequeue need to have a reference to enqueued elements. Moreover API that list email should have references to all the elements in order to get the single one. It's not clear if we have to implement ID at MongoQueue or in specific model (e.g. Email).

Describe the solution you'd like
Search the best option to implement ID, give some examples.

Tasks

  • Search best option
  • implement examples
  • modify existing interface and implementation

Add Reder to watchablequeue

Is your feature request related to a problem? Please describe.
Content enqueued to mongowatchablequeue should be rendered

Describe the solution you'd like
Add Reder dependency in mongowatchablequeue

Sendmail should have async method to Send

Is your feature request related to a problem? Please describe.
In order to enable multiple send we should have a SendAsync method that detaches from main

Describe the solution you'd like
implement SendAsync method that takes in input a callback to be called when some error happens

Refactor limiter

Is your feature request related to a problem? Please describe.
Limiter interrface and its implementation DefaultLimiter can be optimized

Describe the solution you'd like
Limiter must be refactored, interface remains as it is.

Tasks

  • Remove Sleeper
  • Refactor Limiter

Add limiter to whatchablequeue

Is your feature request related to a problem? Please describe.
whatchablequeue doesn't uses limiter in Dequeue.

Describe the solution you'd like
Add limiter in whatchablequeue interface and in mongowhatchablequeue implementation

Create email package and models

Is your feature request related to a problem? Please describe.
Email should have its structure shared among packages

Describe the solution you'd like
Develop email package and models

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.