Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Subscribe without login

Vote:
 

Hi

Is there anyway of using the episerver subscription module without the user having to log in. I was considering users being able to add there email address to a subscription table but my problem is getting the pages that have been added or changed in order to send the notification to the email addresses specified.

Louise

#37230
Feb 25, 2010 17:43
Vote:
 

Yes, if you enable for anonymous users in your web.config file.

Frederik

#37234
Feb 25, 2010 18:33
Vote:
 

I haven't seen that in work, and have made myself some code that automaticly creates users and add them to a subscrtion. Mail me if you want the code at anders.hattestad(at)objectware.no

#37238
Feb 25, 2010 21:57
Vote:
 

Not getting this to work.

Have set the subscription page to allow anonymous users and and changed in IIS to allow all users and all anonymous users.
Is there a step-by-step instruction to not get the login page mailed, but the actual content?! An impersonation of some kind?

The site is an intranet with MultiplexingMembershipProvider with ADProvider and EPiserverMembershipProvider.

#63087
Nov 08, 2012 17:26
Vote:
 

Does the subscribers get emails but the links in the subscription mail shows the login window?

#63090
Edited, Nov 08, 2012 20:45
Vote:
 

Hi Per. Correct!

Emails har sent but the mail shows a login page instead of the intended content. I guess the scheduler doesnt have sufficent/wrong user rights.

#63100
Nov 09, 2012 8:21
Vote:
 

If you check the actual links in the email do they point to an actual page or the /util/login.aspx?

When the sceduling job processes the subscription it creates an Iprincipal of the current subscriber and gets all the roles for that user.

An accesscheck is then made on every possible change that should be sent out. So if you get mails sent they should be the actual links to the page.

If you then get the login page following the links in the subscription mail do the pages have Everyone set for read access?

#63102
Nov 09, 2012 8:56
Vote:
 

No links in the email, just showing a login form. https://dl.dropbox.com/u/16789570/ScreenShot005.png 

Im not able to find the scheduler that process the page.

The subscription page in EPi is set to allow Everyone and even Anonymous read access.

 

#63103
Nov 09, 2012 9:37
Vote:
 

The subscriptionjob takes the profile.Username and creates a Iprincipal object that is used to check acess rights.

So when creating the profile for the subscriber (in your subscription page) the profile.name must be the username used when logging in.

If not all accesschecks will fail in the subscription job.

When the subscriptinjob is run it goes through all profiles in your database.

For each profile it gets all subscribed pages.

For each of the subscribed pages it tries to get all changed pages below (and here the access check is performed). So it's not enough for the user to be able to subscribe to pages. If they don't have access to the pages below they will not get any links in the mail.

If the current subscriber doesn't have read access no subscription link for the email will be created.

The subscription job is a scheduled plugin in the EPiServer.Personalization namespace. I have a very custom subscription so I have modifed both the subsription job and the handler that creates the actual mail.

#63108
Nov 09, 2012 11:07
Vote:
 

Jonas: did you get it to work?

#63339
Nov 15, 2012 10:50
Vote:
 

No, not finding this at all.
Must a override be done to get this work?

Lacking some documentation about this...

#63381
Nov 16, 2012 16:19
Vote:
 

The subscription functionality is located in EPiServer.dll in the EPiServer.Personalization namespace.

If you wan't to modify that stuff you need do your own version. If you don't have reflector you need to get it. Then you can check how EPiServers implementation is done.

 

#63394
Nov 19, 2012 10:39
Vote:
 

Ok debugged some now.

It gets the story from url: /Templates/Emails/SubscriptionUpdate.aspx?id=100&epslanguage=sv&story=37
When I navigate to the address I see it of course. https://dl.dropbox.com/u/16789570/prenumeration.png 

only here it breaks

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            request.Timeout = 10000;
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();// << breaks here
            StreamReader responseStream = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
            string html = responseStream.ReadToEnd();

  a basepage:  

protected override void OnInit(EventArgs e)
        {
            if (CurrentUser == null)  //<< CurrentUser is null
                throw new AccessDeniedException();

            if (Header != null)
                Header.Title = GetDisplayName(CurrentPage);

            base.OnInit(e);
        }

    

So on the request part, how do i impersonate user in code?  

 

#63654
Nov 23, 2012 10:08
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.