netmaker/pro/email/invite.go
Abhishek K 3d765f9cf1
NET-1910: Acl controls for Egress Traffic (#3377)
* add support for egress ranges on acl policy

* add egress ranges to acl rules

* add egress ranges to acl policies

* Add egress ranges to acl rules

* add egress ranges to fw update

* fetch acl rules for egress networks

* apply egress policies for devices

* configure user policies for egresss routes

* fix gw tag name migration

* fix egress acl rules for static nodes

* add egress ranges for static nodes on ingress gw

* fileter acl IPs to be unique

* cleanup IOT logic from peer update

* make acl Rule Dst List

* cleanup egress ranges from acl policies

* create user group default acl policy for gateways

* remove remote access name ids

* rm egress ranges removal from acl policies

* simplify user permissions on nodes

* add additional nameservers to extclient dns

* remove debug logs

* fix static checks
2025-03-18 13:25:55 +04:00

62 lines
2.4 KiB
Go

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("<ol>").
WithHtml(fmt.Sprintf("<li>Click <a href=\"%s\">here</a> to accept your invitation and setup your account.</li>", invite.InviteURL)).
WithHtml("<br>").
WithHtml(fmt.Sprintf("<li><a href=\"%s\">Download the Netmaker Desktop App</a>.</li>", downloadLink))
if invite.PlatformRoleID == models.AdminRole.String() || invite.PlatformRoleID == models.PlatformUser.String() {
content = content.
WithHtml("<br>").
WithHtml(fmt.Sprintf("<li>Access the <a href=\"%s\">Netmaker Dashboard</a> - use it to manage your network settings and view network status.</li>", dashboardURL))
}
connectionID := servercfg.GetNetmakerTenantID()
if !servercfg.DeployedByOperator() {
connectionID = fmt.Sprintf("api.%s", servercfg.GetNmBaseDomain())
}
return content.
WithHtml("</ol>").
WithParagraph("Important Information:").
WithHtml("<ul>").
WithHtml(fmt.Sprintf("<li>When connecting through RAC, please enter your server connection ID: %s.</li>", connectionID)).
WithHtml("</ul>").
WithParagraph(fmt.Sprintf("If you have any questions or need assistance, please contact our support team at <a href=\"mailto:%s\">%s</a>.", supportEmail, supportEmail)).
WithParagraph("Best Regards,").
WithParagraph("The Netmaker Team").
Build()
}