Technical support This forum is closed.
Version 1.x > Technical support > NewsletterSubscription.ascx View modes: 
User avatar
Member
Member
forrester - 5/18/2006 10:39:07 PM
   
NewsletterSubscription.ascx
Can I edit the NewsletterSubscription control? I would like to change the button and some of the wording.

Thanks,
forrester

User avatar
Member
Member
Martin_Kentico - 5/19/2006 1:00:48 PM
   
Re: NewsletterSubscription.ascx
Hello,

Thank you for your post

Yes, of course, you can edit any control or code you wish, you just need to make sure that you reflect the changes into the particular code when you are applying the update to newer version.

The NewsletterSubscription control is just one of the sample controls of the website to provide you the sample code how the newsletter registration procedure could look like, if you need to change it's functionality or look, don't be afraid to do so.

Best regards

User avatar
Member
Member
forrester - 5/19/2006 4:23:12 PM
   
Re: NewsletterSubscription.ascx
I apologize for the unclarity. Looking at the source of the aspx page that the newsletter control is on, I see that it generates a table with class names and input values. I looked at the code-behind, but it appears that it does not generate the class names. Is there another file that holds the functionality and layout of the control? I would rather not have to start from scratch with a new control and just be able to edit the current one, as I am new to C# and am still learning.

Your help and patience is appreciated.

thanks,
forrester

User avatar
Member
Member
forrester - 5/19/2006 4:49:39 PM
   
Re: NewsletterSubscription.ascx
With further research by looking through the Developer's Guide, I found this:

"Please note: The NewsletterSubscriptionDialog control is part of the NewsletterControls library. You may need to add this library to your toolbox."

but when I go to add the dll control to my toolbox, I get this error:

"There are no components in 'C:\Program Files\KenticoCMS\1.8b\DLLs_CS\Kentico.CMS.Newsletter.dll' that can be placed on the toolbox."

I made sure that I was using the the correct version, and still no luck. I also add the CMSControls dll just to make sure that I had all the controls from that.

Thanks,
forrester

User avatar
Member
Member
forrester - 5/19/2006 5:49:46 PM
   
Re: NewsletterSubscription.ascx
The previous thread has been resolved and the newsletter is working, but another has arisen. When I test the control by adding the the email subscription and hit 'subscribe' I get this error: "An error occurred - you haven't been subscribed."...but when I check the newsletter subscriptions, I have been subscribed. I am using 1.8b/C#/vs2003.

Thanks,
forrester

User avatar
Member
Member
Martin_Kentico - 5/24/2006 8:28:02 AM
   
Re: NewsletterSubscription.ascx
Hello,

Well, the NewsletterSubscriptionDialog itself is hard to edit because it is located in the library, you would need to dynamically edit the controls collection of it. But it simply uses the NewsletterManager.Subscribe(...) method that takes care about the subscription itself, so you can define your own control and use this method to do the subscription, that would be probably the easiest solution for what you need.

About the controls library, it seems you tried to use the Newsletter library instead the NewsletterControls library, you probably found out already.

The behaviour you described mostly occurs when the SMTP server is not set properly in the web.config file, so the registration proceeds, but sending the subscribtion confirmation fails, could you please check the SMTP server settings (key CMSSMTPServer)?

If I can be of any further help, please let me know

Best Regards

User avatar
Member
Member
forrester - 5/24/2006 2:19:53 PM
   
Re: NewsletterSubscription.ascx
Martin, Thanks for the reply.

This is what I have in my web config.

"<add key="CMSSMTPServer" value="localhost" />"

I have also tried my IP address and still get the error. Since I am running this on my local machine, is there a configuration setting that I need to set on my machine itself?

Thanks,
forrester

User avatar
Member
Member
Martin_Kentico - 5/24/2006 2:25:45 PM
   
Re: NewsletterSubscription.ascx
Hello,

Mostly, there is no SMTP server set on a regular machine by default, it needs to be set explicitly(if installed as a part of the system) or the third party software must be installed.

You should set the SMTP server adress to your ISP or your WebHosting provider SMTP server, you can also set the SMTP server adress to the SMTP server you use for your e-mail communication, if it does not require the authentication. It shouldn't matter if you enter the IP adress or the DNS adress, what matter is that the SMTP server runs on that machine.

Best Regards

User avatar
Member
Member
forrester - 9/6/2006 8:06:14 PM
   
Re: NewsletterSubscription.ascx
Time to revisit this issue...

I have deployed a new website and still get "An error occurred - you haven't been subscribed." even with the right IP address in the "CMSSMTPServer" key in the web.config.

My contact forms work just fine. It is only the newsletter control that displays the error. Is there another setting that in the configuration that I am overlooking.

Thanks,
forrester

User avatar
Guest
admin - 9/7/2006 4:55:19 PM
   
Re: NewsletterSubscription.ascx
Hello,

could you please check if the new subscriber has been added to the database?

Thank you.

Best Regards,

User avatar
Member
Member
forrester - 9/7/2006 5:37:54 PM
   
Re: NewsletterSubscription.ascx
No, it is not adding my email to the subscriber list.

forrester

User avatar
Guest
admin - 9/11/2006 8:18:09 AM
   
Re: NewsletterSubscription.ascx
Well, it seems the problem is actually caused by the subscription control settings. Could you please write me what values you set to the subscription control properties?

Thank you.

Best Regards,

User avatar
Member
Member
forrester - 9/12/2006 7:51:00 PM
   
Re: NewsletterSubscription.ascx
Hi,

I followed the 2005 tutorial with a sample site and still get the error.

In the web.config I have:
<add key="CMSSMTPServer" value="localhost" />
<add key="CMSSendNewslettersFrom" value="my email" />

On the page I have this:
<%@ Register TagPrefix="cc4" Namespace="Kentico.CMS.NewsletterControls" Assembly="Kentico.CMS.NewsletterControls" %>
<%@ Control Language="C#" Inherits="CorporateSite.NewsletterSubscription" CodeFile="NewsletterSubscription.ascx.cs" %>
<hr>
<b>Sign up for Newsletter:</b>
<cc4:NewsletterSubscriptionDialog id="NewsletterSubscriptionDialog1" runat="server"
NewsletterNodePath="/News/Newsletters/Newsletter-1" />

Thanks,
forrester

User avatar
Guest
admin - 9/13/2006 9:43:59 AM
   
Re: NewsletterSubscription.ascx
thank you for the details. Could yo please go to CMS Desk -> Content -> select your newsletter -> click Properties and tell me what value you have in the Alias path for the newsletter document?

Thank you.

Best Regards,

User avatar
Guest
admin - 9/13/2006 5:41:06 PM
   
Re: NewsletterSubscription.ascx
Hello,

could you please try to run this code on some of your page templates:

NewsletterManager manager = new NewsletterManager( Functions.GetTreeProvider() );
SubscriptionResultEnum result = manager.Subscribe( "/News/Newsletters/Newsletter-1", "youremailaddress", "first name", "last name", "full name", "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath );

Do you receive any error? If not, could you please debug the code and see what value is returned to the result variable?

Thank you.

Best Regards,

User avatar
Member
Member
forrester - 9/13/2006 5:46:38 PM
   
Re: NewsletterSubscription.ascx
Thanks for the quick response and patience. I will give your code a try.

Regards,
forrester

User avatar
Member
Member
forrester - 10/25/2006 3:55:58 PM
   
RESOLVED - NewsletterSubscription.ascx
All is well now. It turns out that there was a conflict on our server with the newsletter and another email application. Once that conflict was resolved, the Newsletter feature worked just fine.

Thanks for your patience.
forrester

User avatar
Member
Member
MRB - 10/26/2006 11:01:27 PM
   
Re: NewsletterSubscription.ascx
I have the same problem.
Getting the error , An error occured-you've not been subscribed

My NewsletterNodePath and alias path : /NewsLetter/NewsLetter1/NewIssue1

I checked with the above code.It threw some exception It says
System.ArgumentException: Column 'NewsletterID' does not belong to table cms.newsletterissue.

So I changed my NewsletterNodePath as /NewsLetter/NewsLetter1 and the result is 1.
What could be the problem.

Thanks in advance
MRB

User avatar
Guest
admin - 10/31/2006 1:57:44 PM
   
Re: NewsletterSubscription.ascx
Hello, you need to subscribe user to the Newsletter (/NewsLetter/NewsLetter1), not to the issue.

Regards,