Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chester Campbell 98 posts 209 karma points
    May 23, 2014 @ 23:23
    Chester Campbell
    0

    umbraco.UmbracoSettings.NotificationEmailSender deprecation ... where to go from here?

    Hi,

    In the past when I wanted to send an email from my app and make it appear to come from the Umbraco site I did this:

    System.Net.Mail.MailMessage m = new MailMessage();
    m.From = new MailAddress(umbraco.UmbracoSettings.NotificationEmailSender);
    

    But now, with Umbraco 7.1.0, I get the following message:

    "Warning: umbraco.UmbracoSettings is obsolete.
    Use UmbracoConfiguration.Current.UmbracoSettings instead,
    it offers all settings in strongly typed formats. This class
    will be removed in future versions."
    

    However, searching the 7.1.0 source solution I cannot find UmbracoConfiguration. And googling it I cannot find any information about it or about how to read umbraco configuration in general.

    Can anyone point me in the right direction?

    Thanks!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 24, 2014 @ 11:56
    Jan Skovgaard
    0

    Hi Chester

    Hmm, did you have a look at the 7.1.3 branch to see if it perhaps exists there?

    /Jan

  • Chester Campbell 98 posts 209 karma points
    May 29, 2014 @ 00:47
    Chester Campbell
    0

    @Jan ... I searched the 7.1.3 solution and didn't find an UmbracoConfiguration class. I did find a reference to it in Umbraco.Web\umbraco.presentation\umbraco\controls\ContentTypeControlNew.ascx.cs ... line 433, which is commented out, is:

    && UmbracoConfiguration.Current.UmbracoSettings.Content.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates
    

    I uncommented the lines and Visual Studio gave me this warning:

    The name "UmbracoConfiguration" does not exist in the current context.
    

    So I guess it's something that is coming in a future release. Maybe someone jumped the gun by marking umbraco.UmbracoSettings as obsolete?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 29, 2014 @ 18:26
    Jan Skovgaard
    0

    Hi Chester

    Yeah sure could seem like it.

    I suppose the old method still works but just gives you the "obsolete" warning then?

    /Jan

  • Dave Clarke 15 posts 127 karma points
    Nov 15, 2017 @ 14:06
    Dave Clarke
    0

    Old topic but hit the same thing earlier today.

    It looks like the way to retrieve this now is via:

    UmbracoConfig.For.UmbracoSettings().Content.NotificationEmailAddress
    
Please Sign in or register to post replies

Write your reply to:

Draft