mirror of
https://github.com/hanzoai/commerce.git
synced 2026-10-30 15:08:42 +00:00
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans, usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0. Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
24 lines
433 B
Go
24 lines
433 B
Go
package email
|
|
|
|
import (
|
|
"crypto/md5"
|
|
"fmt"
|
|
"io"
|
|
|
|
. "github.com/hanzoai/commerce/types"
|
|
)
|
|
|
|
type Subscriber struct {
|
|
FirstName string `json:"firstName"`
|
|
LastName string `json:"lastName"`
|
|
Email Email `json:"email"`
|
|
Metadata Map `json:"metadata"`
|
|
Tags []string `json:"tags"`
|
|
}
|
|
|
|
func (s Subscriber) Md5() string {
|
|
h := md5.New()
|
|
io.WriteString(h, s.Email.Address)
|
|
return fmt.Sprintf("%x", h.Sum(nil))
|
|
}
|