From 152bd37c22133e03898772e90bd167cb867e16f3 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sat, 25 Mar 2023 21:06:59 +0530 Subject: [PATCH] Fix no opt-in mails when existing subscribers subscriber to new opt-in lists. Closes #1257. --- internal/core/subscribers.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/core/subscribers.go b/internal/core/subscribers.go index 2dc386c..e91f441 100644 --- a/internal/core/subscribers.go +++ b/internal/core/subscribers.go @@ -287,7 +287,7 @@ func (c *Core) InsertSubscriber(sub models.Subscriber, listIDs []int, listUUIDs } } - // Fetch the subscriber'out full data. If the subscriber already existed and wasn't + // Fetch the subscriber's full data. If the subscriber already existed and wasn't // created, the id will be empty. Fetch the details by e-mail then. out, err := c.GetSubscriber(sub.ID, "", sub.Email) if err != nil { @@ -379,6 +379,11 @@ func (c *Core) UpdateSubscriberWithLists(id int, sub models.Subscriber, listIDs return models.Subscriber{}, err } + if !preconfirm && c.constants.SendOptinConfirmation { + // Send a confirmation e-mail (if there are any double opt-in lists). + c.h.SendOptinConfirmation(out, listIDs) + } + return out, nil }