mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-06 00:37:24 +03:00
passes subject and email body as parameters
This commit is contained in:
parent
b521f4bfa9
commit
1bb3370e07
3 changed files with 15 additions and 4 deletions
|
@ -189,7 +189,7 @@ func NewClient() echo.HandlerFunc {
|
|||
}
|
||||
|
||||
// EmailClient handler to sent the configuration via email
|
||||
func EmailClient(mailer emailer.Emailer) echo.HandlerFunc {
|
||||
func EmailClient(mailer emailer.Emailer, emailSubject, emailContent string) echo.HandlerFunc {
|
||||
type clientIdEmailPayload struct {
|
||||
ID string `json:"id"`
|
||||
Email string `json:"email"`
|
||||
|
@ -220,8 +220,8 @@ func EmailClient(mailer emailer.Emailer) echo.HandlerFunc {
|
|||
err = mailer.Send(
|
||||
clientData.Client.Name,
|
||||
payload.Email,
|
||||
"Your Wireguard configuration",
|
||||
"instructions here",
|
||||
emailSubject,
|
||||
emailContent,
|
||||
[]emailer.Attachment{cfg_att, qr_att},
|
||||
)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue