Developer forum

Forum » Development » Newsletter v3 notification missing

Newsletter v3 notification missing


Reply
 Hey Guys,

When working with notifications for newsletter v3, we have 3 events to work with,: Created, Deleted and Updated.

When subscribing to a newsletter the notification Created is called, when subscribing with the same email again, Updated is called. When unsubscribing Updated is then called again.

One might expect Deleted to be called when unsubscribing, but seeing what Dynamciweb does when you unsubscribe, it makes a litle sense, since the recipients aren't removed from the database, even when he is no longer subscribing to any newsletter categories.
Deleted is first triggered when a user is deleted via the backend.

What i'd like is a notification that runs when a user is trying to unsubscribe, since running Updated when unsubscribing isn't all that intuitiv.

But maybe the notifications are minded the backend part of Newsletter v3?

Regards
 Martin



Replies

 
Reply
What i'm trying to archieve is to replicate any changes made in Dynamicweb newsletter v3, to Mailchimp.

My problem is that i can't identify wether a subscriber is updating or unsubscribing.
Since both hit the same event, and the argument for the notification doesn't tell me which it is i can't be sure what to do.

Regards
 Martin

 
Reply
Hi Martin,

I agree a separate notification would be very useful. Until then, you can work around it as follows:

1. Add a hidden field to the Unsubscribe template like this:

<input type="hidden" name="unsubscribe" value="true" />

2. In your NotificationSubscriber, check for the presence of the field like this:

if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Form["unsubscribe"]))
{
  // Unsubscribe
}
else
{
  // Profile update
}

Hope this helps,

Imar

 

You must be logged in to post in the forum