2
0

user_notifier.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 SendProjectDeleteEmailOpts struct {
  21. Project string
  22. Email string
  23. }
  24. type UserNotifier interface {
  25. SendPasswordResetEmail(opts *SendPasswordResetEmailOpts) error
  26. SendGithubRelinkEmail(opts *SendGithubRelinkEmailOpts) error
  27. SendEmailVerification(opts *SendEmailVerificationOpts) error
  28. SendProjectInviteEmail(opts *SendProjectInviteEmailOpts) error
  29. SendProjectDeleteEmail(opts *SendProjectDeleteEmailOpts) error
  30. }
  31. type EmptyUserNotifier struct{}
  32. func (e *EmptyUserNotifier) SendPasswordResetEmail(opts *SendPasswordResetEmailOpts) error {
  33. return nil
  34. }
  35. func (e *EmptyUserNotifier) SendGithubRelinkEmail(opts *SendGithubRelinkEmailOpts) error {
  36. return nil
  37. }
  38. func (e *EmptyUserNotifier) SendEmailVerification(opts *SendEmailVerificationOpts) error {
  39. return nil
  40. }
  41. func (e *EmptyUserNotifier) SendProjectInviteEmail(opts *SendProjectInviteEmailOpts) error {
  42. return nil
  43. }
  44. func (e *EmptyUserNotifier) SendProjectDeleteEmail(opts *SendProjectDeleteEmailOpts) error {
  45. return nil
  46. }