Listen out for when a User confirms newsletter subscription

Tracey Penberthy asked on March 21, 2017 18:31

Hi

How do I listen out for when a user confirms their newsletter subscription? That is when an email feed has double opt in enabled.

I know I can listen out for SubscriberNewsletterInfo.TYPEINFO.Events.Update but this also gets fired when the subscription is first added and when it gets deleted. I specifically want to know when the user has clicked the confirm the subscription link.

Many Thanks Tracey

Recent Answers


Brenden Kehren answered on March 21, 2017 18:40

You'd have to check specifically if the SubscriptionApproved and the SubscriptionApprovalHash have specific values in them. For instance if the use is confirming the subscription and you have two events:

SubscriberNewsletterInfo.TYPEINFO.Events.Update.Before and SubscriberNewsletterInfo.TYPEINFO.Events.Update.After

You can check to see if the SubscriptionApproved = true in the before event, if it does not, then do something. Or you can check in the After event if you'd like. Just depends on what you want to do.

0 votesVote for this answer Mark as a Correct answer

Tracey Penberthy answered on March 22, 2017 10:26

Thanks for that Brenden

So there's no single event that gets fired when a user approves their subscription?

I see if I can compare the before and after update events to see if SubscriptionApproved changes.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 22, 2017 17:00

So yes and no to your question:

So there's no single event that gets fired when a user approves their subscription?

There is no specific event for "approve subscription". Yes, there is an event in which you can perform a check to see if it is approved, it's what I mentioned above.

0 votesVote for this answer Mark as a Correct answer

Tracey Penberthy answered on March 23, 2017 09:55

Thanks for confirming that Brenden, much appreciated

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.