Skip to content

feat(service): add MailKite email service - #1063

Open
bucabay wants to merge 1 commit into
nikoksr:mainfrom
bucabay:add-mailkite-service
Open

feat(service): add MailKite email service#1063
bucabay wants to merge 1 commit into
nikoksr:mainfrom
bucabay:add-mailkite-service

Conversation

@bucabay

@bucabay bucabay commented Sep 5, 2026

Copy link
Copy Markdown

Description

This PR adds a new notification service for MailKite, an email API for sending and receiving transactional mail.

The service sends messages through the MailKite Send API (POST /v1/send) with a Bearer API key. It follows the shape of the Mailtrap service merged in #1045: New(apiKey, senderAddress, opts...), AddReceivers, BodyFormat(HTML|PlainText), and functional options WithSenderName, WithReplyTo, WithBaseURL, WithHTTPClient. Standard library only (net/http), so no new dependencies.

Disclosure: I build MailKite. I am happy to maintain this service going forward (API changes, issues, follow-ups) and will watch for anything filed against service/mailkite.

Motivation and Context

Users of notify who send with MailKite currently have to go through the generic SMTP mail service. This adds first-class support alongside the other email providers (Amazon SES, Mailgun, Mailtrap, SendGrid) so the API key path works directly, with a reply-to option since notification replies usually belong somewhere other than the sender address.

How Has This Been Tested?

  • Table-driven unit tests in service/mailkite/mailkite_test.go using httptest.Server to assert the request method, path, Authorization: Bearer … / Content-Type headers, and the JSON body (from with and without a display name, multiple receivers, reply-to, HTML vs plain text), plus constructor/options, error-status and transport-error cases. go test -race -cover ./service/mailkite/... passes with 95.2% coverage.
  • go build ./... and go vet ./service/mailkite/... clean.
  • golangci-lint v2.7.2 with this repo's .golangci.yaml: 0 issues. gofumpt, golines --shorten-comments -m 120 and gofmt report no changes.
  • The request body (from, to[], subject, html/text, replyTo) is the same shape MailKite's own Go SDK sends to the production API; I have not wired a live send into the test suite, so the tests are all against the local mock server.

Screenshots / Output (if appropriate):

ok  	github.com/nikoksr/notify/service/mailkite	1.435s	coverage: 95.2% of statements
0 issues.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant