notifier.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package notifier
  2. type SendPasswordResetEmailOpts struct {
  3. Email string
  4. URL string
  5. }
  6. type SendGithubRelinkEmailOpts struct {
  7. Email string
  8. URL string
  9. }
  10. type SendEmailVerificationOpts struct {
  11. Email string
  12. URL string
  13. }
  14. type SendProjectInviteEmailOpts struct {
  15. InviteeEmail string
  16. URL string
  17. Project string
  18. ProjectOwnerEmail string
  19. }
  20. type UserNotifier interface {
  21. SendPasswordResetEmail(opts *SendPasswordResetEmailOpts) error
  22. SendGithubRelinkEmail(opts *SendGithubRelinkEmailOpts) error
  23. SendEmailVerification(opts *SendEmailVerificationOpts) error
  24. SendProjectInviteEmail(opts *SendProjectInviteEmailOpts) error
  25. }
  26. type EmptyUserNotifier struct{}
  27. func (e *EmptyUserNotifier) SendPasswordResetEmail(opts *SendPasswordResetEmailOpts) error {
  28. return nil
  29. }
  30. func (e *EmptyUserNotifier) SendGithubRelinkEmail(opts *SendGithubRelinkEmailOpts) error {
  31. return nil
  32. }
  33. func (e *EmptyUserNotifier) SendEmailVerification(opts *SendEmailVerificationOpts) error {
  34. return nil
  35. }
  36. func (e *EmptyUserNotifier) SendProjectInviteEmail(opts *SendProjectInviteEmailOpts) error {
  37. return nil
  38. }