mirror of
https://github.com/knadh/listmonk.git
synced 2025-01-28 01:04:46 +08:00
Add unsubscribe link to opt-in confirmation e-mail. Closes #573.
This commit is contained in:
parent
28efe27cbe
commit
3f026090ca
2 changed files with 3 additions and 0 deletions
|
@ -65,6 +65,7 @@ type subOptin struct {
|
|||
*models.Subscriber
|
||||
|
||||
OptinURL string
|
||||
UnsubURL string
|
||||
Lists []models.List
|
||||
}
|
||||
|
||||
|
@ -830,6 +831,7 @@ func sendOptinConfirmation(sub models.Subscriber, listIDs []int64, app *App) (in
|
|||
qListIDs.Add("l", l.UUID)
|
||||
}
|
||||
out.OptinURL = fmt.Sprintf(app.constants.OptinURL, sub.UUID, qListIDs.Encode())
|
||||
out.UnsubURL = fmt.Sprintf(app.constants.UnsubURL, dummyUUID, sub.UUID)
|
||||
|
||||
// Send the e-mail.
|
||||
if err := app.sendNotification([]string{sub.Email},
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<p>
|
||||
<a href="{{ .OptinURL }}" class="button">{{ L.Ts "email.optin.confirmSub" }}</a>
|
||||
</p>
|
||||
<a href="{{ .UnsubURL }}">{{ L.T "email.unsub" }}</a>
|
||||
|
||||
{{ template "footer" }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue