Newsletter Widget Failure

Topics: Controls
Feb 5 at 2:06 AM
If the newsletter widget is in the side column (not in the footer) then it seems it should work without code changes. The discussion in other posts only seem to apply to problems when this widget is in the footer. Mine is not in the footer, it's in the side column and I have a pretty vanilla implementation on WinHost. Also, testing my email works fine.

However, no email is generated when a new post is published. I've tried every suggestion I could find on this forum - with no joy.

I only use two widgets in addition to the admin widget: Text and Newsletter. Text and Admin work fine. I really would like to have the newsletter widget working - so any suggestions will be greatly appreciated - except a link to that old thread that's not relevant.
Feb 6 at 6:07 AM
I am having the same issue. I am currently using running on SQL Server 2014. Newsletter widget visible on right side widget zone and it doesn't seem to do anything. I have yet to modify any source components but will certainly do so if I can get someone to tell me what needs to be changed. This widget is important for me to notify those that have subscribed.

Additionally I can't seem to find the database table that houses the newsletter subscribers to see who it is that isn't getting notified. If someone could shed some light on that too I would appreciate it.

Feb 9 at 1:30 AM
This is pretty frustrating. BlogEngine is a great piece of software and I deeply appreciate the time and effort of the people who created it. However, I first posted about this issue on Jan 31st [discussion:576026] because I'm trying to make a decision about going live with an application that could use BlogEngine. So far, the only reply I got was not relevant to the problem. If there is a workaround or if nothing can be done about the problem - either way, I'll be truly thankful for some guidance.
Feb 9 at 3:21 PM
When you go to widget edit screen, do you see emails added to the list? It is 2 step process, creating list of subscribers and processing this list on post publish. Also helps to tell what version you using, otherwise I assume it is latest 3.2 with default XML provider.
Feb 10 at 9:12 PM
Below is what I did to get it working.
I only have need for posts and there have not bothered about pages.

Change 'public Widget' to
        public Widget()
            Post.Publishing += PostPublishing;
            Post.Published += PostPublished;

            Post.Serving += Post_Serving;
Comment out/remove this method
public override void Dispose()

Replace 'PublishableSaved' method with:
        private void PostPublished(object sender, System.EventArgs e)
            var publishable = (IPublishable)sender;

            var data = GetSendNewslettersContextData();
            if (!(data.ContainsKey(publishable.Id) && data[publishable.Id])) return;

            XmlNodeList emails = null;
            lock (syncRoot)

                emails = docs[Blog.CurrentInstance.Id].SelectNodes("emails/email");

            if (emails == null) { return; }

            List<MailMessage> messages = new List<MailMessage>();
            foreach (XmlNode node in emails)
                string address = node.InnerText.Trim();

                if (!Utils.StringIsNullOrWhitespace(address) && Utils.IsEmailValid(address))
                    MailMessage message = CreateEmail(publishable);
            if (messages.Count == 0) { return; }

            // retrieve the blogId before entering the BG thread.
            Guid blogId = Blog.CurrentInstance.Id;

            ThreadPool.QueueUserWorkItem(state =>

                // because HttpContext is not available within this BG thread
                // needed to determine the current blog instance,
                // set override value here.
                Blog.InstanceIdOverride = blogId;

                foreach (MailMessage message in messages)
Replace the 'PublishableSaving' method with:
        private static void PostPublishing(object sender, System.ComponentModel.CancelEventArgs e)
            // Set SendNewsletterEmails to true whenever a publishable is changing from an unpublished
            // state to a published state.  To check the published state of this publishable before
            // it was changed, it's necessary to retrieve the publishable from the datastore since the
            // publishable in memory (via Post.GetPost() or Page.GetPage()) will already have the
            // updated values about to be saved.

            var publishable = (IPublishable)sender;

            SetSendNewsletterEmails(publishable.Id, false); // default to not sending

            if (publishable is Post && !SendEmailsForPosts)
            SetSendNewsletterEmails(publishable.Id, true);
Works for me
Feb 10 at 10:13 PM
rtur: yes, if I bring up the edit screen for the widget, I see my two test emails that I put in for getting notifications.

I'm using 3.2.04 and testing my email settings works fine. However, I never get any notification to those emails on the widget screen when I add a new post.

I see Goran has posted his fix. Do you agree that this is the only way to fix the problem or do you have a recommendation? Thanks.
Feb 11 at 2:37 AM
I'm currently replacing all widgets with Razor versions, all controls going away. If you using 3.2.04 you probably will be better of getting latest after this weekend, it should have newsletter widget updated.
Feb 11 at 2:51 AM
Thanks rtur, I'll watch for a new version this coming weekend or Monday and redo my implementation. Time is short for my launch, but getting it up next week is still workable. I'll give you feedback immediately after I have it up on WinHost.
Feb 16 at 12:47 AM
Hi rtur, perhaps you could post a note here when the new version is ready - thanks
Feb 16 at 1:08 AM
Couple days ago (on Github). Let me know if you see something odd.
Feb 16 at 1:38 AM
Thanks rtur, I wasn't watching GitHub. Will work with this over the next few days and post back here.
Feb 16 at 3:06 AM
Hi rtur, Not doing very well. The first problem is trying to open a post - I get is this error with IE11 - does not happen with Edge, Chrome or Firefox. Pressing continue in IE11 does proceed normally to open the post for reading.


When in admin mode, I can't find any way to manage the widgets. There are no gizmos in the upper right corner of the widgets to remove them and there is no dropdown box to add new ones.

I did switch to the standard 2015 theme but the problems are the same in both. I tried both the single and multi user modes with same problems.
Feb 16 at 2:11 PM
The IE error seems related to - developer extension for VS.
To manage widgets, in admin/custom select widgets and you should see something like this.
Feb 16 at 7:39 PM
For the browser error, are you suggesting that users with regular IE11 won't have the problem after I publish it to WinHost ?

For Widgets,I like that new method much better than the previous way of fiddling with the live page. I can do the Widget Admin In Chrome OK, but not in IE11- this is all I see in IE11:

Feb 16 at 9:29 PM
I'm saying you might need to turn off browser link in visual studio when starting BE. It can pick up noise from outside BE, and error you see that prevents widgets from showing may be something completely unrelated. I can see widgets in IE 11 with and without browser link just fine.
Feb 16 at 9:39 PM
Edited Feb 17 at 2:34 AM
Hi rtur, I tried using the new controls with source code, It looks cool but I am finding few issues

1. Most of the custom controls are throwing error when Edit is clicked, here is the error

Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Custom/Widgets/shared.cshtml

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1038.0

I see the Shared.cshtml has been replaced with common, but some where it is still referring to this

__In Edit.cshtml,
var widgetId = Request.QueryString["id"];
__It is returning a null value which is further causing an error when it is calling the database
Feb 16 at 10:11 PM
Hi rtur,

I wasn't even aware of browser link feature and turning it off did stop the error.

Regarding admin widget panel using IE 11: it comes up as shown in my image above - however, if I refresh the browser page, it then appears properly and works fine.

So, things are looking up :-) thanks for your replies.
Feb 17 at 1:37 PM
Hi rtur,
A small problem with the Textbox Widget. I've tried many different ways and browsers to add a link inside the textbox with no joy. I've also fiddled around with the tinymce settings in Custom->Widgets->Textbox->edit.cshtml to no benefit. The problem is that the "Save" button doesn't appear properly and trying to click the small part I can see doesn't cause an update.

Feb 17 at 2:32 PM
Styles not done yet, our designer will work on it making it look better and adding responsiveness.
Feb 18 at 8:15 PM
Hi rtur,
I edited the xml to insert the link.

I published on WinHost and now the Newsletter widget is working. I think the new admin page makes it much more clear that there is a newsletter plugin that needs to be enabled. Not sure if I did that before or not.

Although my site is not technically launched for this season, you can see it by clicking the "sneak preview" button and then scrolling down a little ways to click the "Blog" icon. It's a very basic implementation of BlogEngine with only a minimum set of features - at least for now. If you're interested, you can see it Here