emailserv

module
v0.0.0-...-ecb895a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2018 License: MIT

README

Installation

It requires GO in version 1.10 and dep for dependency management.

After fetching sources, run the following command in project's directory:

dep ensure
make install # or make build

Required services

It also requires access to Amazon SNS and SendGrid services.

How to use

Authorization

Application has a very simple authorization method, you need to specify a token by providing it as command line parameter and then use it in http header (Authorization).

Run an application with a command:

emailserv -amazon.key "..," -amazon.secret "..." -sendgrid.key "..." -token "..."

Example request

{
    "sender": "test@example.com",
    "recipients": [
        "a@example.com",
        "b@example.com"
    ],
    "bcc_recipients": ["c@example.com"],
    "body": "email content"
}

Exmaple response

{
    "message": "Request tnot valid",
    "validation_errors": [
        {
            field: "sender",
            error: "invalid email address"
        }
    ],
    "error": true
}

NOP client

There is a way to debug application without sending emails, in order to do so, run an application with flag: -nop. Messages will be logged but not sent.

Directories

Path Synopsis
cmd
internal
emailclient
Package specifies a common interface for all email clients, e.g.
Package specifies a common interface for all email clients, e.g.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL