Skip to main content

Prerequisites

Send email

package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    url := "https://app.mailrify.com/api/v1/emails"

    payload := strings.NewReader("{
     "from": "Your app <no-reply@yourdomain.com>",
     "to": "client@example.com",
     "subject": "Welcome to Mailrify 🚀",
     "html": "<p>It works! 👋</p>",
     "text": "It works!"
    }")

    req, _ := http.NewRequest("POST", url, payload)
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("Authorization", "Bearer YOUR_API_KEY")

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()

    body, _ := io.ReadAll(res.Body)
    fmt.Println(res)
    fmt.Println(string(body))
}

More

  • Explore the API Reference to discover additional endpoints you can call for workflows beyond sending a single email.