ASPX templates
Version 6.x > ASPX templates > Question: New Blog Post To Email Subscribers View modes: 
User avatar
Member
Member
kadams-pediatricweb - 6/10/2013 9:05:36 AM
   
Question: New Blog Post To Email Subscribers
I am trying to do something that is very easy to set up in Wordpress but seems impossible(?) to do in Kentico. Hopefully someone can help.

I set up a Content Subscription module using these instructions (http://devnet.kentico.com/docs/devguide/index.html?subscribing_users_to_content_changes_notifications.htm) but I am having problems with the following:

1. The Subscribe feature for the Content Subscription module will not show on the site unless you are logged into Kentico. What needs to be done to show it for any visitor to the site?

2. If you subscribe to the notifications where do those emails go into Kentico? What if someone wants to unsubscribe? How do I get that taken care of?

3. The notification displays a link to the new post in the email but I want the full title and blog post instead. What are the commands to make that work? Or is there a better way to do this?

Thank you!

User avatar
Member
Member
kentico_sandroj - 6/10/2013 8:58:02 PM
   
RE:Question: New Blog Post To Email Subscribers
Hello,

The Content Subscription Web part only shows while logged in because it uses the current user context to populate the e-mail field. In order to change that functionality, you would have to modify the Web part:

~\CMSWebParts\Notifications\ContentSubscription.ascx.cs

Once subscribed, the e-mail are sent to the e-mail address that was used to sign up for the subscription, which is the currently logged-in users e-mail address. If you would like to offer the option to unsubscribe, you would add the unsubscription link to the template which is being e-mailed for each change (specified in the Web part).

In order to change the content which is sent in the notification e-mail, you would update the template under Site Manager > Development > Notifications. More information can be found in this article.

Does this information help? Please let us know if you have additional questions.

Regards,
Sandro

User avatar
Member
Member
kadams-pediatricweb - 6/11/2013 4:44:51 PM
   
RE:Question: New Blog Post To Email Subscribers
Thanks Sandro! We are going to give this a try.

Kim

User avatar
Member
Member
sarah.bartell-merge - 7/19/2013 4:01:57 PM
   
RE:Question: New Blog Post To Email Subscribers
Were you able to get this to work? I need to have the same functionality on the blog we are setting up - ie, let users subscribe to a new blog post notification without having to register.

How do you modify the content subscription webpart to show to all non-registered users? I am running version 6, portal templates. Thank you!

User avatar
Member
Member
kentico_sandroj - 7/22/2013 2:40:04 PM
   
RE:Question: New Blog Post To Email Subscribers
Hello,

You would open this file: \CMSModules\Notifications\Controls\NotificationSubscription\NotificationSubscription.ascx.cs

and find this statement:

if ((CMSContext.CurrentUser == null) || (CMSContext.CurrentUser.IsPublic()))
{
this.StopProcessing = true;
this.Visible = false;
return;
}


You can just remove it or comment it out. Also, please note this change in case of future upgrade or hotfix so it won't be overwritten back to defaults.

Regards,
Sandro

User avatar
Member
Member
sarah.bartell-merge - 7/23/2013 2:54:13 PM
   
RE:Question: New Blog Post To Email Subscribers
Thank you Sandro. I was able to get this to work for anonymous subscriptions.

Now my question is, how do I offer the unsubscribe link in the email?

I tried using {%unsubscribelink%}, but nothing happens.

User avatar
Member
Member
sarah.bartell-merge - 7/23/2013 2:57:35 PM
   
RE:Question: New Blog Post To Email Subscribers
And also, is the subscribers email address stored somewhere in Kentico? If so, where?

User avatar
Member
Member
kentico_sandroj - 7/24/2013 12:14:51 PM
   
RE:Question: New Blog Post To Email Subscribers
Hello,

The subscriber e-mail is stored in the Blog_PostSubscription table as well as CMS Desk > Administration > Users > edit user > Subscriptions > Blog post subscriptions.

The issue with the unsubscribe link could be caused by a bug if you are not on the latest hotfix.

Could you please test this one: {%BlogPost.BlogPostTitle%}

Please let me know if that outputs anything.

According to the documentation it takes two things to make the macros work:

1. Place the Blog post unsubscription web part onto a page. It is recommended to create a special page for this purpose, as you can see at Community site -> Special-pages -> Blog unsubscribe. You can set only one specific property of the web part - Confirmation text - this is the text that will be displayed after successful unsubscription.

2. Set the URL of the page created in step 1 as the Unsubscription URL property of the blog. This can be done two ways:

•In Site Manager -> Settings -> Content -> Blogs, by settings the Blog unsubscription URL property. This is the default value that will be used by default, if no other URL is set.

•If some different URL is set in the option mentioned above, you can set the value of the Unsubscription URL property on the blog's Form tab. This value overrides the one set in Site Manager -> Settings -> Content -> Blogs.


Please let me know if you have any questions.

Regards,
Sandro

User avatar
Member
Member
sarah.bartell-merge - 7/24/2013 12:26:44 PM
   
RE:Question: New Blog Post To Email Subscribers
Hi Sandro,

I understand that Blog Comment Subscriptions would be stored in CMS Desk > Administration > Users > edit user > Subscriptions > Blog post subscriptions, however because we are using the Content Subscription web part with "Create Event Enabled" and are allowing anonymous, non-registered users to subscribe to an email notification (the event being New Blog Post), the email address is not housed under Administration > Users. Is it stored anywhere else? I'm guessing this is why unsubscriptions are not working.

The process you describe above is set up and is working perfectly for Blog Comment Subscriptions using {%unsubscribelink%} in the email notification

User avatar
Member
Member
kentico_sandroj - 7/24/2013 3:57:56 PM
   
RE:Question: New Blog Post To Email Subscribers
Hi Sarah,

Thank you for clarifying the situation. In that case, the subscription are stored in the Notification_Subscription table. Since the users are anonymous, it is not possible to view the subscriptions within the UI. Also, in order to unsubscribe the users with a link, you would have to build the link similar to the following:

<a href="http://YourDomain.com/SpecialPages/Unsubscribe.aspx?subscriberguid={%SubscriberGUID%}&newsletterguid={%NewsletterGUID%}&issueid={%IssueID%}">Unsubscribe</a>

Only the macros explained in this document will work in the e-mail.

Please let me know if you have any additional questions.

Regards,
Sandro

User avatar
Member
Member
sarah.bartell-merge - 7/25/2013 11:30:45 AM
   
RE:Question: New Blog Post To Email Subscribers
Hi Sandro,

I set up the notification email template with the following unsubscribe link:
<a href="http://www.mycompanyname.com/Blogs/UnsubscribeBlog.aspx?notifcationuserid={%notificationuser.UserID%}">Unsubscribe</a>

The link works and appears to pull the correct data, but it's not removing users from the database.

On my Unsubscribeblog.aspx page, I need to use an unsubscribe webpart in order for this to work, correct? I tried using the message board unsubcription webpart and modified the code behind to access Notification Subscriptions instead of message board subscriptions but it's still not working.

what am i missing?

User avatar
Member
Member
kentico_sandroj - 7/25/2013 5:38:02 PM
   
RE:Question: New Blog Post To Email Subscribers
Hello,

I apologize but the first link is incorrect, this is the link you would use:

~/SpecialPages/Unsubscribe/Blog.aspx?subscriptionguid={%subscriptionguid%}

If you use this link you will not have to create your own Web part, you can use the default Blog Unsubscription Web part: ~\CMSWebParts\Blogs\BlogPostUnsubscription.ascx.cs

Place this Web part on the page where the link is pointing and the user should be unsubscribed.

I am currently testing this so if I find any other details I will provide an update.

User avatar
Member
Member
sarah.bartell-merge - 7/26/2013 9:34:06 AM
   
RE:Question: New Blog Post To Email Subscribers
Unfortunately this didn't work for me. The subscriptionguid comes up blank when you click on the link from the notification email.

Like this: /Blogs/Unsubscribe.aspx?subscriptionguid=

When I used notificationsubscription.SubscriptionID, for the unsubscribe link, it did return with a valid id number but didn't unsubscribe the user.

User avatar
Member
Member
kentico_sandroj - 7/26/2013 3:54:50 PM
   
RE:Question: New Blog Post To Email Subscribers
Hi Sarah,

So we've investigated this issue a bit more and by looking at the source code we found that the unsubscription Web parts would not work because they expected a valid UserInfo object which cannot be created for public users. Unfortunately, you would either have to develop a custom Web part that removes the subscriptions based on the subscription guid, or you could modify the Web part to create fake user information so that the UserObject can be created. The information can be stored in a custom table then you can work with the custom table API.

Either approach should work but it may be easier (and better for performance) to remove the subscriptions through custom code instead of creating the userinfo object.