A service interface and implementations for sending transactional authentication emails via SMTP, SendGrid, or console logging.
// Source: https://github.com/omnara-ai/omnara | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package email
import (
"bytes"
"context"
"crypto/tls"
_ "embed"
"encoding/json"
"errors"
"fmt"
"html/template"
"mime"
"mime/multipart"
"mime/quotedprintable"
"net"
"net/http"
"net/mail"
"net/smtp"
"net/textproto"
"strings"
"time"
"github.com/omnara-ai/omnara/internal/outboundhttp"
)
const (
smtpDefaultTimeout = 10 * time.Second
sendGridHTTPTimeout = 10 * time.Second
)
var defaultSendGridHTTPClient = outboundhttp.NewPublicClient(
outboundhttp.PublicClientOptions{Timeout: sendGridHTTPTimeout},
)
type Sender interface {
SendInvite(ctx context.Context, to, orgNam
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key