yudppp / simple-sendgrid-mock-server

Simple Sendgrid(v3) Mock Server And Mail Box

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simple-sendgrid-mock-server

DockerHub

Simple SendGrid Mock Server is SendGrid Mock Server on Docker. Mail is not actually sent. Instead, you can see the mails sent to you like a mailer. And SendGrid v3 API Support.

Usage

Using the Docker image

Starting on the command-line:

docker run -p 3030:3030 -env SENDGRID_API_KEY=YOUR_API_KEY -env SESSION_COOKIE_SECRET=YOUR_SECRET  -t yudppp/simple-sendgrid-mock-server

The port 3030 is for HTTP.

Input

SendGrid Web API v3 mock,

go example

import 	"github.com/sendgrid/sendgrid-go"

func SendMail() error {
	request := sendgrid.GetRequest(mockAPIKey, "/v3/mail/send", mockedHost)
  ...
}

Output

Like Mailer

login page

Login Page

Please input your YOUR_API_KEY.

Viewer

Mailer Page

API

Responced Stored All Message.

> curl http://localhost:3030/json?token=YOUR_API_KEY
[
  {
    "personalizations": [
      {
        "to": [
          {
            "email": "example@example.com"
          }
        ]
      }
    ],
    "from": {
      "email": "example@example.com"
    },
    "subject": "Hello, World!",
    "sent_at": 1630322977319,
    "content": [
      {
        "type": "text/plain",
        "value": "Heya!"
      }
    ]
  },
  {
    "personalizations": [
      {
        "to": [
          {
            "email": "example@example.com"
          }
        ]
      }
    ],
    "from": {
      "email": "example@example.com"
    },
    "subject": "Hello, World!",
    "sent_at": 1630322914938,
    "content": [
      {
        "type": "text/plain",
        "value": "Heya!"
      }
    ]
  }
]

About

Simple Sendgrid(v3) Mock Server And Mail Box

License:MIT License


Languages

Language:Pug 57.2%Language:JavaScript 39.9%Language:Dockerfile 2.9%