invite.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package email
  2. import (
  3. "fmt"
  4. "github.com/gravitl/netmaker/servercfg"
  5. )
  6. // UserInvitedMail - mail for users that are invited to a tenant
  7. type UserInvitedMail struct {
  8. BodyBuilder EmailBodyBuilder
  9. InviteURL string
  10. }
  11. // GetSubject - gets the subject of the email
  12. func (UserInvitedMail) GetSubject(info Notification) string {
  13. return "You're invited to join Netmaker"
  14. }
  15. // GetBody - gets the body of the email
  16. func (invite UserInvitedMail) GetBody(info Notification) string {
  17. if servercfg.DeployedByOperator() {
  18. return invite.BodyBuilder.
  19. WithParagraph("Hi there,").
  20. WithParagraph("<br>").
  21. WithParagraph("Great news! Your colleague has invited you to join their Netmaker SaaS Tenant.").
  22. WithParagraph("Click the button to accept your invitation:").
  23. WithParagraph("<br>").
  24. WithParagraph(fmt.Sprintf("<a class=\"x-button\" href=\"%s\">Accept Invitation</a>", invite.InviteURL)).
  25. WithParagraph("<br>").
  26. WithParagraph("Why you'll love Netmaker:").
  27. WithParagraph("<ul>").
  28. WithParagraph("<li>Blazing-fast connections with our WireGuard®-powered mesh VPN</li>").
  29. WithParagraph("<li>Seamless multi-cloud and hybrid-cloud networking</li>").
  30. WithParagraph("<li>Automated Kubernetes networking across any infrastructure</li>").
  31. WithParagraph("<li>Enterprise-grade security with simple management</li>").
  32. WithParagraph("</ul>").
  33. WithParagraph("Got questions? Our team is here to help you every step of the way.").
  34. WithParagraph("<br>").
  35. WithParagraph("Welcome aboard,").
  36. WithParagraph("<h2>The Netmaker Team</h2>").
  37. WithParagraph("P.S. Curious to learn more before accepting? Check out our quick start tutorial at <a href=\"https://netmaker.io/tutorials\">netmaker.io/tutorials</a>").
  38. Build()
  39. }
  40. return invite.BodyBuilder.
  41. WithParagraph("Hi there,").
  42. WithParagraph("<br>").
  43. WithParagraph("Great news! Your colleague has invited you to join their Netmaker network.").
  44. WithParagraph("Click the button to accept your invitation:").
  45. WithParagraph("<br>").
  46. WithParagraph(fmt.Sprintf("<a class=\"x-button\" href=\"%s\">Accept Invitation</a>", invite.InviteURL)).
  47. WithParagraph("<br>").
  48. WithParagraph("Why you'll love Netmaker:").
  49. WithParagraph("<ul>").
  50. WithParagraph("<li>Blazing-fast connections with our WireGuard®-powered mesh VPN</li>").
  51. WithParagraph("<li>Seamless multi-cloud and hybrid-cloud networking</li>").
  52. WithParagraph("<li>Automated Kubernetes networking across any infrastructure</li>").
  53. WithParagraph("<li>Enterprise-grade security with simple management</li>").
  54. WithParagraph("</ul>").
  55. WithParagraph("Got questions? Our team is here to help you every step of the way.").
  56. WithParagraph("<br>").
  57. WithParagraph("Welcome aboard,").
  58. WithParagraph("<h2>The Netmaker Team</h2>").
  59. WithParagraph("P.S. Curious to learn more before accepting? Check out our quick start tutorial at <a href=\"https://netmaker.io/tutorials\">netmaker.io/tutorials</a>").
  60. Build()
  61. }