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