Copied to clipboard

Flag this post as spam?

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


  • Jeremias 53 posts 278 karma points
    Aug 02, 2016 @ 06:49
    Jeremias
    0

    Control content with Render Tasks in Newsletterstudio 2.1.4

    Hi all together,

    I need to programm my own render task in Newsletterstudio 2.1.4 For this I watched the video in the following link: http://support.newsletterstudio.org/customer/en/portal/articles/1052872-control-content-with-render-tasks

    My Problem is, that the Version of the RenderTaskSample-Project seems to have the wrong version, because I only get an error-messageb when I add the dll from the renderTask-project to my current project:

    Could not load types from assembly Company.NewsletterStudio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, errors: Exception: System.TypeLoadException: The type "NewsletterStudio.Services.RenderTask" in the assembly "NewsletterStudio, Version=2.1.4.0, Culture=neutral, PublicKeyToken=null" could not be loaded. Exception: System.TypeLoadException: The type "NewsletterStudio.Services.RenderTask" in the assembly "NewsletterStudio, Version=2.1.4.0, Culture=neutral, PublicKeyToken=null" could not be loaded.

    I downloaded the RenderTask Sample.zip from this page: https://our.umbraco.org/projects/backoffice-extensions/newsletter-studio/ You find this project in the tab "Documentation"

    Is there anybody who can help me with this problem? My Umbraco-Version is 7.2.8.

    Thanks for your help!

  • Markus Johansson 1911 posts 5756 karma points MVP c-trib
    Aug 06, 2016 @ 09:41
    Markus Johansson
    0

    Hi!

    The interface of the render task has changes slightly since the example project was created.

    You will have to reference the correct version of newsletter studio in your tender task project and you could use your IDE to "implement all members" of the interface you'll be able to compile and run.

    / m

  • Jeremias 53 posts 278 karma points
    Aug 08, 2016 @ 06:48
    Jeremias
    0

    Hi!

    Thank you very much!! I did it how you told me and it seems to work. But there is one little problem I have: When I start the email delivery (with papercut), only the ProcessPreRender-Method is called!

    Here is the code of my class:

    using NewsletterStudio.Services.RenderTasks;
    
    namespace Company.NewsletterStudio
    {
        class RenderNewsletterMarker : RenderTask
        {
            public override void ProcessPreRender(RenderResult renderResult, RenderTaskParameters parameters)
            {
                renderResult.MessageBody = renderResult.MessageBody.Replace("[anrede]", "ProcessPreRender");
            }
    
            public override void ProcessPreview(RenderResult renderResult, RenderTaskParameters parameters)
            {
                renderResult.MessageBody = renderResult.MessageBody.Replace("[anrede]", "ProcessPreview");
            }
    
            public override void ProcessUniqueItem(RenderResult renderResult, RenderTaskUniqueItemParameters parameters)
            {
                renderResult.MessageBody = renderResult.MessageBody.Replace("[anrede]", "ProcessUniqueItem" + parameters.EmailTrackingItem.Email);
            }
        }
    }
    

    Is anything wrong?

  • Markus Johansson 1911 posts 5756 karma points MVP c-trib
    Aug 08, 2016 @ 08:46
    Markus Johansson
    0

    Hi!

    Are you sending a preview or a "real" send out?

    // m

  • Jeremias 53 posts 278 karma points
    Aug 08, 2016 @ 08:55
    Jeremias
    0

    Hi!

    I send a "real" mail!enter image description here And this is the header of the newsletter I'm sending. You see, that there is "ProcessPreRender" in the first lineenter image description here

    Maybe you have an idea, how to fix that!

    Thanks!

  • Markus Johansson 1911 posts 5756 karma points MVP c-trib
    Aug 08, 2016 @ 08:59
    Markus Johansson
    100

    Are you using a breakpoint or just juding by the screenshot?

    Since you have the same placeholder "[anrede]" will be replaces by the ProcessPreRender-method and then when ProcessUniqueItem runs it won't find any [anrede] in the content.

    Might be a good idea to change the placeholder for the unique item to something else - ie. [anredeunique]

    // m

  • Jeremias 53 posts 278 karma points
    Aug 08, 2016 @ 08:59
    Jeremias
    0

    And this is the line I added to the newsletterStudio.config:

    <task name="RenderNewsletterMarker" type="Company.NewsletterStudio.RenderNewsletterMarker, Company.NewsletterStudio" />
    
  • Markus Johansson 1911 posts 5756 karma points MVP c-trib
    Aug 08, 2016 @ 09:03
    Markus Johansson
    0

    Since ProcessPreRender fires you can be sure that you're configuration are correct.

  • Jeremias 53 posts 278 karma points
    Aug 08, 2016 @ 09:13
    Jeremias
    0

    Hi Markus,

    thank you! That's the thing I didn't know/understand till five minutes ago. First the preRender-function is called and then the uniqueItem-Function. I changed the marker for the unique thing and now it works! Thanks for your patience!

    Jeremias

Please Sign in or register to post replies

Write your reply to:

Draft