Copied to clipboard

Flag this post as spam?

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


  • horsted 74 posts 136 karma points
    Sep 20, 2022 @ 12:44
    horsted
    0

    Change default email width?

    Hi Markus, I'm testing the latest version for our upcomming new site and just WOW - NLS has come a long way and has become an even more amazing tool :-)

    Our newsletter has a width of 720px and when I making a custom theme and change all the '600px' widths to '720px' in newsletterStudio.css, then the newsletter width in 'Content' is 720px, but I can't make the inserted images wider than (the default) 600px minus margins. Also in the 'Preview' the newsletter is still 600px wide when previewed in 'Desktop'.

    Is there a setting somewhere to change the default width for a 'Workspace' ?

    And is is possible to change the default margin (preferable all 4 values) for a 'Workspace'?

    TIA and have a nice day :-)

  • Markus Johansson 1945 posts 5898 karma points MVP 2x c-trib
    Sep 20, 2022 @ 13:17
    Markus Johansson
    0

    Hi!

    Thanks a lot for your kind feedback! Have been working hard on the new version =D

    First of all, the experience for using a custom width is not 100% straight forward but I think it should be possible.

    The email editor has 4 columns at max, there is a setting that represents the width in pixels for each column.

    NewsletterStudioConstants.EmailDesign.PixelsPerColumn
    

    Out of the box this is set to 150px (4x150=600). You should be able to override this during startup.

    NewsletterStudioConstants.EmailDesign.PixelsPerColumn = 180;
    

    However, the width in the preview is currently hardcoded in our CSS. If you looking to /App_Plugins/NewsletterStudio/newsletterStudio.css you should be able to find all selectors that used the width 600px.

    You could then create your own "plugin" and only insert a stylesheet to override these selectors.

    I know that this is not a great experience but we have not got any requests for this so far so have not invested a lot of time into making it easy.

    I hope that you're willing to give this a try!?

    Please let me know if you need any further assistance to try it out!

    Cheers!

    Edit: The padding settings do not have any settings at the moment I'm afraid.

  • horsted 74 posts 136 karma points
    Sep 20, 2022 @ 13:51
    horsted
    0

    Thanks for your fast response!

    I found where to edit the 'Preview' width - it's in '~/Themes/MyTheme/Views/Email.cshtml'

        .container__table {
            margin: 0 auto;
            width: 100%;
            @* max-width: 600px; *@
            max-width: 720px;
        }
    

    I'm sure willing to try out overriding the PixelsPerColumn, but not a hardcore coder, so I have no idea how/where to do it, so assistance would be much appreciated, thanks :-)

  • Markus Johansson 1945 posts 5898 karma points MVP 2x c-trib
    Sep 22, 2022 @ 09:04
    Markus Johansson
    100

    Hi!

    Sounds like a great solution to use a custom theme to override the defaults for rendering.

    When it comes to the constant there is several ways to override this. You could just use this in your Startup.cs-file or create a composer:

    namespace My.Website
    {
       public class SubscribeToContentServiceSavingComposer : IComposer
       {
           public void Compose(IUmbracoBuilder builder)
           {
                NewsletterStudioConstants.EmailDesign.PixelsPerColumn = 180;
           }
       }
    }
    

    There is more info about composers and how to create them here: https://our.umbraco.com/documentation/implementation/composing/

  • horsted 74 posts 136 karma points
    Sep 26, 2022 @ 10:31
    horsted
    0

    It works like a charm - thank you :-)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies