Copied to clipboard

Flag this post as spam?

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


  • Jud Connelly 2 posts 22 karma points
    Oct 12, 2011 @ 17:33
    Jud Connelly
    0

    SSL for email notifications

    We are using a SSL certificate for Umbraco and when I am testing the email notifications the webmaster receives when a page is "sent to publish" or "published" the link at the top of the email saying:

    "This is an automated mail to inform you that the task 'Send to Publish' has been performed on the page 'About Us' by the user XXXX."

    The link for the 'About Us' is still pointing to http instead of https. Where do I make the change to this parameter to change the url to https?

  • Essy 74 posts 96 karma points
    Jul 12, 2012 @ 13:07
    Essy
    0

    I have exactly the same problem - the links in the email specify port 443 but use http instead of https.

    If the smtp settings in the web config are set to "enableSsl" then no notifications are sent at all!

  • Nurhak Kaya 53 posts 147 karma points MVP 3x c-trib
    Oct 11, 2016 @ 14:59
    Nurhak Kaya
    0

    I know this is an old topic but I am experiencing the same problem with Umbraco version 7.4.2 assembly: 1.0.5921.28477 . Has anybody found a solution to this?

    The link in the automated mail is pointing to http instead of https even though I use a SSL certificate for Umbraco.

    Link: http://mydomainname:443/umbraco/#/content/content/edit/7158

    Thanks in advance.

  • Nurhak Kaya 53 posts 147 karma points MVP 3x c-trib
    Oct 12, 2016 @ 10:51
    Nurhak Kaya
    0

    I found a solution to my problem after digging more into the Umbraco-CMS source code. I hope it helps other developers as well.

    All I did was changing the following key to "true" in the web.config, this was set to "false" before.

    <appSettings>
    ...
      <add key="umbracoUseSSL" value="true" />
    ...
     </appSettings>
    

    After this change, umbraco started to create notification emails with the correct button link urls as shown below:

    (https://mydomainname:443/umbraco/#/content/content/edit/7158)

    For more details please continue to read:

    Please click here for Umbraco documentation for umbracoUseSSL parameter.

    If you click here, you will see the source code for Umbraco's NotificationService.cs. In this class if you go to Line 399, you will see how umbraco gets the protocol value.

    string protocol = GlobalSettings.UseSSL ? "https" : "http";
    

    If you search for GlobalSettings in the Github repository, then you will find this in src/Umbraco.Web/WebApi/Filters/UmbracoUseHttps.cs.

    using GlobalSettings = Umbraco.Core.Configuration.GlobalSettings;
    

    And as the last step if you view the Umbraco.Core.Configuration source code, then you can find UseSSL method. As you can see, all you need to do is update the "umbracoUseSSL" key value in your web.config.

     /// <summary>
            /// Gets a value indicating whether umbraco should force a secure (https) connection to the backoffice.
            /// </summary>
            /// <value><c>true</c> if [use SSL]; otherwise, <c>false</c>.</value>
            public static bool UseSSL
            {
                get
                {
                    try
                    {
                        return bool.Parse(ConfigurationManager.AppSettings["umbracoUseSSL"]);
                    }
                    catch
                    {
                        return false;
                    }
                }
            }
    

    Happy coding.

Please Sign in or register to post replies

Write your reply to:

Draft