package email import ( "fmt" "github.com/gravitl/netmaker/models" proLogic "github.com/gravitl/netmaker/pro/logic" "github.com/gravitl/netmaker/servercfg" ) // UserInvitedMail - mail for users that are invited to a tenant type UserInvitedMail struct { BodyBuilder EmailBodyBuilder InviteURL string PlatformRoleID string } // GetSubject - gets the subject of the email func (UserInvitedMail) GetSubject(info Notification) string { return "Connect to Your Secure Network Using Netmaker" } // GetBody - gets the body of the email func (invite UserInvitedMail) GetBody(info Notification) string { downloadLink := "https://www.netmaker.io/download" supportEmail := "support@netmaker.io" dashboardURL := fmt.Sprintf("https://dashboard.%s", servercfg.GetNmBaseDomain()) if servercfg.DeployedByOperator() { dashboardURL = fmt.Sprintf("%s/dashboard?tenant_id=%s", proLogic.GetAccountsUIHost(), servercfg.GetNetmakerTenantID()) } content := invite.BodyBuilder. WithParagraph("Hi,"). WithParagraph("You've been invited to access a secure network via Netmaker Desktop App. Follow these simple steps to get connected:"). WithHtml("
    "). WithHtml(fmt.Sprintf("
  1. Click here to accept your invitation and setup your account.
  2. ", invite.InviteURL)). WithHtml("
    "). WithHtml(fmt.Sprintf("
  3. Download the Netmaker Desktop App.
  4. ", downloadLink)) if invite.PlatformRoleID == models.AdminRole.String() || invite.PlatformRoleID == models.PlatformUser.String() { content = content. WithHtml("
    "). WithHtml(fmt.Sprintf("
  5. Access the Netmaker Dashboard - use it to manage your network settings and view network status.
  6. ", dashboardURL)) } connectionID := servercfg.GetNetmakerTenantID() if !servercfg.DeployedByOperator() { connectionID = fmt.Sprintf("api.%s", servercfg.GetNmBaseDomain()) } return content. WithHtml("
"). WithParagraph("Important Information:"). WithHtml(""). WithParagraph(fmt.Sprintf("If you have any questions or need assistance, please contact our support team at %s.", supportEmail, supportEmail)). WithParagraph("Best Regards,"). WithParagraph("The Netmaker Team"). Build() }