Spaces:
Paused
Paused
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca Download api/pkg/emails/mailer.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 517 Bytes
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/emails/mailer.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway@6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/emails/mailer.go
-
curl -L -o mailer.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/6917738ca6db1603dee9e07994b4e42d5e1ae9b2/api/pkg/emails/mailer.go
517 Bytes
| package emails | |
| import ( | |
| "context" | |
| "fmt" | |
| "strings" | |
| ) | |
| // Email represents an email message | |
| type Email struct { | |
| ToName string | |
| ToEmail string | |
| Subject string | |
| HTML string | |
| Text string | |
| } | |
| func (mail *Email) toAddress() string { | |
| if strings.TrimSpace(mail.ToName) != "" { | |
| return fmt.Sprintf("%s <%s>", mail.ToName, mail.ToEmail) | |
| } | |
| return mail.ToEmail | |
| } | |
| // Mailer is used for sending emails | |
| type Mailer interface { | |
| // Send adds a message to the push queue | |
| Send(ctx context.Context, mail *Email) error | |
| } | |