Note: This is an internal library used within the Kopexa core ecosystem. It is not intended for public use.
Comms is a flexible and extensible email communication library for Go that enables easy integration with various email services. It is primarily used within Kopexa's internal services and applications.
- π Easy integration with various email services
- π§ Support for HTML and text emails
- π Attachment support
- π·οΈ Tagging system for email categorization
- π Email address validation
- π§ͺ Comprehensive test coverage
go get github.com/kopexa-grc/commsWarning: This library is licensed under BUSL-1.1 and is intended for internal use within Kopexa. Please ensure you have the appropriate permissions and licensing before using this library.
package main
import (
"context"
"log"
"github.com/kopexa-grc/comms"
"github.com/kopexa-grc/comms/driver/resend"
)
func main() {
// Configure Resend driver
driver := resend.New("your-api-key")
// Create Comms instance
c := comms.New(
comms.WithDriver(driver),
comms.WithFrom("noreply@example.com"),
)
// Create recipient
recipient := comms.NewRecipient(
"user@example.com",
"John",
"Doe",
)
// Send email
err := c.SendVerifyEmail(context.Background(), recipient, "123456")
if err != nil {
log.Fatal(err)
}
}The Resend driver enables sending emails through the Resend service.
driver := resend.New("your-api-key")The Mock driver is designed for testing purposes and simulates email sending.
driver := mock.NewDriver()Comms supports HTML and text templates for emails. Templates are written in Go template syntax and can contain dynamic data.
templates/
βββ verify_email.html
βββ verify_email.txt
text, html, err := comms.Render("verify_email", data)WithDriver(driver.Driver): Sets the email driverWithFrom(string): Sets the sender email address
c := comms.New(
comms.WithDriver(driver),
comms.WithFrom("noreply@example.com"),
)- Go 1.21 or higher
- Make
make buildmake testmake lintThis project is licensed under the BUSL-1.1 License. This license is specifically designed for internal use within Kopexa and its ecosystem.
For security issues, please read our SECURITY.md file.
Contributions are welcome! Please read our Contributing Guidelines for details.
For questions or issues, please create an issue in the GitHub repository.