BE - Can this be fixed?

Feb 26, 2014 at 1:39 PM
I am using BE with SQL CE, SimpleBlog theme. I have only the stock as is Newsletter widget installed in the footer Widget Zone. It is set to sendmail for posts and pages true. In order to have the Newsletter send out a notification I must first delete the Newsletter and then reinstall it, then create a new post or uncheck publish, save, recheck publish, and save the page. If I do the delete, and install it sends out the notifications, it will not send without doing a delete/install first. Thank you.
Feb 27, 2014 at 6:03 PM
Feb 28, 2014 at 10:34 PM
Edited Feb 28, 2014 at 10:34 PM
Is anyone else having this issue with the Newsletter?
Mar 4, 2014 at 12:53 PM
I am still hoping someone will take this on.
Mar 7, 2014 at 12:06 PM
Do the developers not think that this is an issue that should be fixed, surely the Newsletter in BE is a valuable asset and should work without having to delete and reinstall.
Mar 7, 2014 at 6:43 PM
I'll double check, but pretty sure if works in current code without any re-installs. In any case, to fix something we would need exact steps to reproduce error in latest stable release (2.9.1).
Mar 7, 2014 at 7:12 PM
Edited Mar 7, 2014 at 7:21 PM
Thanks, the server I am on on Arvixe doesn't support 2.9 yet, they are supposed to be doing a transfer sometime in the near future. I am using at the present time. Should I try the latest Newsletter widget with my present setup, I would need to have it update on posts and pages?

Actually according to this discussion it does not work in BE above 2.8.01.
Mar 8, 2014 at 7:18 AM
Hi Rtur, and Jerry,

Using BlogEngine.NET


I can confirm that the Newsletter does not work for some reason.

When doing the mail test it sends email out ok and also with comments.

But, for some reason with BE 2.9 as is with out changing the newsletter code it does not work.

Since BE 2.9 is an web application the Newsletter .cs file is not on the server but complied into the .dll

So far getting no errors in the Logger, but got one in Elmah when I delete and reinstall the Newsletter widget.

I get an Invalid viewstate error.

But other than that no other error or clues why it is not sending.

Going to now edit the code behind file in source and re upload to see if that corrects the issue.

But, it should work out out the box "as-is" through.

The other options send on Page should be in the edit screen of the Newsletter Widget and not hard coded into the widget requiring editing of the source code to get it working :)

Will report results.
Mar 8, 2014 at 7:57 AM
Got it working!!!
     /// <summary>
    ///     Whether emails are sent for posts.
    /// </summary>
    private const bool SendEmailsForPosts = true;
When this is set to true it works:

SetSendNewsletterEmails(publishable.Id, false); // default to not sending <--- Causes Newsletter not to send even when

SendEmailsForPosts = true;

Now having it True:

SetSendNewsletterEmails(publishable.Id, true); // Now works

So for some reason the SendEmailsForPosts variable set at the start is not carrying over its value.

The area that might have the issue is below:

private static void PublishableSaving(object sender, SavedEventArgs 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, true); // default to not sending

        if (publishable is Post && !SendEmailsForPosts)
        else if (publishable is BlogEngine.Core.Page && !SendEmailsForPages)

        if (e.Action == SaveAction.Insert && publishable.IsVisibleToPublic)
            SetSendNewsletterEmails(publishable.Id, true);
        else if (e.Action == SaveAction.Update && publishable.IsVisibleToPublic)
            var preUpdatePublishable = (IPublishable)null;

            if (publishable is Post)
                preUpdatePublishable = (IPublishable)BlogService.SelectPost(publishable.Id);
                preUpdatePublishable = (IPublishable)BlogService.SelectPage(publishable.Id);

            if (preUpdatePublishable != null && !preUpdatePublishable.IsVisibleToPublic)
                // Note, use publishable.Id below instead of preUpdatePublishable.Id because
                // when directly calling BlogService.SelectPage or BlogService.SelectPost,
                // the Guid ID is not set, and so will be a random, non-matching Guid ID.

                SetSendNewsletterEmails(publishable.Id, true);
Mar 8, 2014 at 8:05 AM
So far working really well with no errors.
Mar 9, 2014 at 12:42 AM
Edited Mar 9, 2014 at 12:46 AM
Hi Brian,

SetSendNewsletterEmails(publishable.Id, true); //

I changed the above to true in the widget.ascx.cs, published it and it did not send out a notification when I unchecked publish, saved, checked publish, saved on a page. This is with the stock newsletter and using the SimpleBlog theme. When I delete and re add the Newsletter it does work and it also sends out the one that did not work without the delete process first.

Thanks for your help.

Mar 9, 2014 at 10:55 AM
Hi Jerry,

After reviewing the Newsletter Code there are lots of areas where the [true/ false] values can change.

I bet when you delete the widget and add it back in, it sets the correct settings for the [true/false] values where they need to be.

So it starts out at the correct settings for [true/false] values.

But, some where and some how, these values are being changed and causing you these issues.

Because of this you changing the value I recommended might or not not work or if it does work it might be reset later on.

This you are back to your original problem.

I think you had mention that you have custom code for your newsletter?

I notice on your website you have different lists to join.

It could be your custom code.

Best way to resolve this issue for you once and for all is to email me a zip copy of your /NewsletterWidget Folder.

If you have any other custom code that is out side of the newsletter widget need those too.

Also need your /CurrentTheme folder too

With testing I can confirm that BE "as-is" after the change of false --> true fixes the issue.

Had not tested for any side effects, but it does send email out really fast after each post, or page update or new one and even with Page as front page.

With out requiring deleting and adding back the widget.

You can send me your zip folder directly at: Also I sent you an direct email yesterday did you get it :) ?

Have a great day!

Brian Davis
Mar 9, 2014 at 10:58 AM
Edited Mar 9, 2014 at 11:19 AM
Ok now getting some side effects with newsletter.

Sending multiple emails now :)

Don't use the settings false --> sending out batches of 3 emails per (update,delete,new, or unpublish-->Republish)

Do not apply the changes recommended, now back to the drawing board :)

Will provide updates once got it figured out.
Mar 9, 2014 at 1:25 PM
Thanks Brian, at this time I only have the stock newsletter with it set to also send notifications for updated pages as well as posts, nothing custom and I am now using only one list for all notifications, I deleted the other 2.
Mar 9, 2014 at 1:33 PM
Ok :)

I am still looking into the default settings on why it is having issues.

Yesterday when made change only had 1 email being sent out and it worked fine.

Today for some reason it is sending out batches of "3" emails per [Post/Page] (Action)

So I think application is changing some setting during application restarts.

So going to put logging into each section to see what I find.

Will update progress here.
Mar 9, 2014 at 2:06 PM

Where do I put the settings in widget/edit for it to post page updates also, at this time I want to put a fresh 2.8 widget in my site without any changes and have it send updated pages also. Thanks
Mar 9, 2014 at 2:57 PM
File: widget.ascx.cs

Line 66: private const bool SendEmailsForPages = false;

Change that to true
Mar 10, 2014 at 9:24 PM
Thanks Brian, I was referring to this:

The other options send on Page should be in the edit screen of the Newsletter Widget and not hard coded into the widget requiring editing of the source code to get it working :)

private const bool SendEmailsForPages = false;
Mar 11, 2014 at 2:15 PM
Hi Jerry,


I misunderstood what you meant.

You mean how to get the Widget to have the settings to change the bool value of SendEmailsForPages from with in the widget itself.

You would have to edit these files:


In edit.ascx have to create a check box or a radio button. Have label Check to send email for pages

Then in edit.ascs.cs have it save what ever was changed in the button to change the value of the

SendEmailsForPages variable (Constant)

I am working on getting this into the newsletter widget hopefully have it ready in about 3-10 days?

But, here are some code about 75% done on what would need to be done through:

Not functional code just general idea on what to do :)


<data name="SendEmailForPages" xml:space="preserve">
<value>Send Newsletter for Page Updates?</value>


<label style="display: block; margin: 10px 0 5px 0" for="<%=chkPageEmail%>">
<asp:CheckBox runat="server" ID="chkPageEmail"/>


At the very top of file
const bool SendEmailsForPages;

In Public Method area put the following in:

if(chkPageEmail.Checked == false)
SendEmailsForPages = false;

else if (chkPageEmail.Checked == true)
SendEmailsForPages = true;


private const bool SendEmailsForPages = false;

from File: widget.ascx.cs

Line 66: private const bool SendEmailsForPages = false;

Some editing to widget.ascx.cs

Above code is almost complete would need some more editing of the widget.ascx.cs file not sure what
exactly would be needed.
Mar 11, 2014 at 2:39 PM

It is nice to see that you are concerned about getting the newsletter working as it should. I find it confusing that the developers are not really concerned about the functioning of the newsletter. Surely there must be a lot of BE 2.9 users out there that need the newsletter working. At this point I do not see any reason to upgrade to 2.9, I have to delete/reinstall the newsletter widget every time I need a notification sent but at least I have that option, be it worth what it is.

Mar 11, 2014 at 3:35 PM
Hi Jerry,

The developers have their hands-full in many things and just very busy not a matter of the Newsletter being important or not.

I am doing what I can on my own free time to help with this issue.

Since I am also having issues with the newsletter and also need it, I am doing my best to get it working :)

BE is going though a lot of changes and lots of things had changed and with that lots of issues had been introduced and need to be solved.

With the new issues, development and code corrections are focused on those issues.

So I volunteer to help what I can to work on the Newsletter :)

But, being limited in time going to take a while to fix and then test live on server.

Goal is to have it fixed and working in about 5-10 days hopefully.

Will keep update here.

Have a great day!

Brian Davis
Mar 11, 2014 at 4:10 PM
Hi Brian,

I am not sure if this will help you or not. When I had the other 2 custom newsletters they seemed to work without the delete/install process I am doing now to send notifications. They were setup to send when eHike and eBulletin were introduced in the code. However the updated stock Newsletter was and is the one I have issues with. The customs newsletters had code from a few versions back. Would sending you the eHIke newsletter widget help you at all?

Mar 14, 2014 at 6:13 PM
Hi Jerry,

Update so far.

Seems like the issue might be with the Global.asax file.

Line-118: WidgetZone.PreloadWidgetsAsync("be_WIDGET_ZONE");

Here it loads the be_widget_zone

I find if the newsletter is in the footer_widget zone and not in the be_widget_zone newsletter does not go out.

If I move the newsletter to the be_widget_zone newsletters are sent out and seems to be working correctly.

If I add the following the the Global.asax file

It sends out newsletter too.

But, note you can't have both in Global.asax


Doing so will send out two newsletter emails per post instead of one.

So it seems like the solution is to make sure to only have the widget zone where the newsletter is located at in the

WidgetZone.PreloadWidgetsAsync("The Widget Zone where Newsletter is located");

Double check your theme to make sure you have the exact widget zone name.

Once that is done seems to fix the issue :)

Let me know if that works for you.

Have a great day!

Brian Davis

Mar 14, 2014 at 8:45 PM
Edited Mar 14, 2014 at 10:11 PM
Hi Brian,

I made the change you suggested in the Global.asax file , the SimpleBlog theme has "Footer_Widget" listed as"Footer-Widget". You nailed it, the Newsletter sends out the notifications as it should without me having to delete/reinstall the widget. Thank you very much for putting in all the time you did to fix this issue. I will just need to remember this change when and if I change themes. I thank you and the Blogengine community thanks you, hopefully this will be documented somewhere so users will have access to this information. It would be nice if all themes that have a footer widget have it listed as "Footer_Widget".

Mar 14, 2014 at 11:51 PM
Thank you all for illuminating the issue. Does all this only apply to BE 2.8.x?? What I see in my director is
../blog/Global.asax. When that is opened, I do not see a "Footer_Widget" or "Footer-Widget.

Here's the code for the class that has the only reference to "Widget"

private class FirstRequestInitialization
    private static bool _initializedAlready = false;
    private readonly static object _SyncRoot = new Object();

    // Initialize only on the first request
    public static void Initialize(HttpContext context)
        if (_initializedAlready) { return; }

        lock (_SyncRoot)
            if (_initializedAlready) { return; }

            WidgetZone.PreloadWidgetsAsync("be_WIDGET_ZONE");   __<------------------------__




                new ScriptResourceDefinition
                    Path = "~/Scripts/jquery-1.9.1.min.js",
                    DebugPath = "~/Scripts/jquery-1.9.1.js",
                    CdnPath = "",
                    CdnDebugPath = ""

            _initializedAlready = true;
I have BE 2.9.1
Am I missing somethig from the hard work all of you presented here?
Sorry if I did, but could you please briefly look at this?

The Newsletter widget seems to recognize a bad email address, but I corrected it and it's still inactive when clicking [Send].
Mar 15, 2014 at 12:03 AM
If you are using a theme with a footer widget zone and you place the Newsletter Widget in this widget zone you will need to change






or whatever your theme uses for the footer widget.
Mar 15, 2014 at 12:08 PM
Hi Jerry,

So the newsletter issue for you is 100% solved then?

After several days of trying to figure out what the issue was yesterday (Friday) decided to take a look at the Global.asax file to see what was going on.

Then I saw


Right then I knew that was the issue :)

Did some tests and confirm that was the issue.

Additional Improvements:
  1. Some how have BE find which zone the Newsletter Widget is in and add that zone to the WidgetZone.PreloadWidgetsAsync settings in Global.asax
Or have some way that it is softcoded and not hard coded manually into the Global.asax file.

Users should not have to change this if using a theme that has the newsletter widget in another Widget zone other than the default be_WIDGET_ZONE

Currently working on:
  1. Softcoding selection of having a check box in the widget to select send newsletter on page changes (new,update)

Future Improvements to work on:
  1. Make a Newsletter Extension that gives the Newsletter more mailing list functions like user management, Send an "Email" directly to mailing list with out creating a post or page, with the ability to select specific emails to send it to, groups, or entire list.
  2. Manage bounce backs
and more ...

If any one has any features they wish to have in a Newsletter Extension please let me know either by posting it here or emailing it directly to me at: Have a great day!

Brian Davis

Mar 15, 2014 at 1:17 PM
Hi Brian,

Yes the Newsletter is working 100% for me now. The new features you are working on sound great. Thanks for all your hard work and dedication you have put into getting this issue fixed and working as it should.

Mar 19, 2014 at 7:22 PM
kbdavis07, thank you so much for working on the solution for the newsletter. I spent a long time trying to figure it out in the code and then looking for the answer online. I've done a few test posts now, and it seems to work perfectly. Thanks again!!!

Much appreciation,

Mar 19, 2014 at 9:21 PM
Hi Jerry, HappyTweeter, and Others,

Thanks for your comments :)

I am currently in the works a developing a MailingList manager that will integrate with BlogEngine.Net so keep an out eye for it :)

Will be creating a website for it and will post the link here.

If you have any features you like to see added post your wishlist here :)

Have a Great day!

Brian Davis

Apr 26, 2014 at 6:40 PM
I've read this interesting discussion, because I'm having challenges getting notification to work.

I've subscribed to my own email address so that I will be notified when a new blog post is added.

What have I done so far:
  • I've verified my email settings and that appears to be configured correctly
  • I'm getting an email when a comment is placed and my "test email settings" sends me nicely an email
  • I've checked my Global.asax file and verified that it contains this line:
    This corresponds with my theme (using the standard theme)
  • I don't have a widget added for the newsletter, only what is standard in the footer of the standard theme.
I do not get an email when I add a new post or modify one.

Any pointers?

Apr 26, 2014 at 8:23 PM
Ah...don't know what happend, but after a while (app pool recycling?) it started to work...
Jun 18, 2014 at 12:55 PM
Hi Brian,

Are you still working on a Mailing list Manager?


Jun 18, 2014 at 11:08 PM
Hi Jerry,

Its a big work in progress, so far just working on it locally.

Once I get it in a presentable form with some updates will upload that to its Official Website :)

"Just In Time Contact"

For now the website does not have anything on it yet, been very busy lately with lots of things going on so I work on it
when ever I get free time.

Will keep you posted on its status :)

What features are you looking for in the Mailing List Manager for your needs?
Jun 19, 2014 at 2:55 AM
Hi Brian,

I would like the ability to check a box to have a notification sent out with a page change in addition to a new post notification. I am running 2.8 now but probably won't upgrade to 2.9 without this ability to make a change without having to make the change and then have to rebuild the website.

Thanks for all you do.