wpd-message-gateway

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT

README ΒΆ

WPD Message Gateway

Go Reference Go Report Card

A unified Go package for sending messages through multiple providers. One API, any provider.

Installation

go get github.com/weprodev/wpd-message-gateway

Quick Start

1. Configure environment:

export MESSAGE_DEFAULT_EMAIL_PROVIDER=mailgun
export MESSAGE_MAILGUN_API_KEY=your-api-key
export MESSAGE_MAILGUN_DOMAIN=mg.yourdomain.com
export MESSAGE_MAILGUN_FROM_EMAIL=noreply@yourdomain.com

2. Send an email:

package main

import (
    "context"
    "github.com/weprodev/wpd-message-gateway/config"
    "github.com/weprodev/wpd-message-gateway/contracts"
    "github.com/weprodev/wpd-message-gateway/manager"
)

func main() {
    cfg, _ := config.LoadFromEnv()
    mgr, _ := manager.New(cfg)

    mgr.SendEmail(context.Background(), &contracts.Email{
        To:      []string{"user@example.com"},
        Subject: "Welcome!",
        HTML:    "<h1>Hello from Go!</h1>",
    })
}

Providers

Type Provider Status
πŸ“§ Email Mailgun βœ… Ready
πŸ“§ Email SendGrid πŸ“‹ Planned
πŸ“§ Email AWS SES πŸ“‹ Planned
πŸ“± SMS Twilio πŸ“‹ Planned
πŸ”” Push Firebase πŸ“‹ Planned
πŸ’¬ Chat WhatsApp πŸ“‹ Planned

Documentation

Development

make test       # Run tests
make lint       # Run linter
make sandbox    # Interactive testing CLI

License

MIT

Directories ΒΆ

Path Synopsis
cmd
sandbox command
Package config provides configuration loading and management for message providers.
Package config provides configuration loading and management for message providers.
Package contracts defines the interfaces and data types for message providers.
Package contracts defines the interfaces and data types for message providers.
Package errors provides error types for the message gateway.
Package errors provides error types for the message gateway.
examples
email command
Email example demonstrates sending an email using go-message-provider.
Email example demonstrates sending an email using go-message-provider.
Package manager provides the central gateway for message dispatching.
Package manager provides the central gateway for message dispatching.
providers
email/mailgun
Package mailgun implements the contracts.EmailSender interface using the Mailgun API.
Package mailgun implements the contracts.EmailSender interface using the Mailgun API.

Jump to

Keyboard shortcuts

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