mail.go 644 B

1234567891011121314151617181920212223242526272829303132333435
  1. package mail
  2. import "mime/multipart"
  3. // Type for mail
  4. type Type uint8
  5. // Mail types
  6. const (
  7. TypeTextPlain Type = iota
  8. TypeTextHTML
  9. )
  10. // Attach def.
  11. type Attach struct {
  12. Name string
  13. File multipart.File
  14. ShouldUnzip bool
  15. }
  16. // Mail def.
  17. type Mail struct {
  18. ToAddresses []*Address `json:"to_addresses"`
  19. CcAddresses []*Address `json:"cc_addresses"`
  20. BccAddresses []*Address `json:"bcc_addresses"`
  21. Subject string `json:"subject"`
  22. Body string `json:"body"`
  23. Type Type `json:"type"`
  24. }
  25. // Address def.
  26. type Address struct {
  27. Address string `json:"address"`
  28. Name string `json:"name"`
  29. }