Copied to clipboard

Flag this post as spam?

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


  • antao 81 posts 371 karma points
    Jul 31, 2015 @ 15:08
    antao
    0

    ProcessUniqItem() in CustomRenderTask

    Hi,

    I am using NewsletterStudio version 1.4.1 and Umbraco (6.2.4 specifically), I cannot change the render values in my render task class above:

    Any help would be really appreciated.

     public override void ProcessUniqItem(RenderResult renderResult, RenderTaskUniqItemParameters parameters)
            {
                renderResult.MessageBody = renderResult.MessageBody.Replace("[antao]", "joao.antao");
            }
    

    Thanks.

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Aug 01, 2015 @ 10:04
    Markus Johansson
    0

    Hi!

    The code looks right... except that the line is commented out...

    Did you add your RenderTask to the configuration file in /config/newsletterStudio.conig?

    If you debug with a breakpoint - does the execution hit your code?

    // m

  • antao 81 posts 371 karma points
    Aug 01, 2015 @ 10:36
    antao
    100

    Hi Markus,

    This is the .config line, for the custom render task:

    < task name="UnsubscribeRenderTask"
    type="Bril.Umbraco.NewsletterStudio.UnsubscribeRenderTask,
    Bril.Umbraco.NewsletterStudio" />

    I could not get a hitting execution there as well, any help is really appreciated.

    EDIT - The ProcessPreRender() override methods get in the hitting execution, and work A ok. (they are in the same class)

  • antao 81 posts 371 karma points
    Aug 03, 2015 @ 14:14
    antao
    0

    Upgraded to version 1.4.5.1 (latest to be release for v6.x versions, I believe) when in 'Send test email' mode the custom unique attribute does not change. It will only happen in a 'real' send-out.

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Aug 03, 2015 @ 14:28
    Markus Johansson
    1

    Hi!

    Thanks right!

    Since a preview is not a "real" representation of the newsletter the preview can't render something that is tied to a specific receiver.

    In preview mode you can use the "ProcessPreview()"-method to replace a placeholder with some generic information to illustrate the feature.

      public override void ProcessPreview(RenderResult renderResult, RenderTaskParameters parameters)
            {
                string html = renderResult.MessageBody;
                html = html.Replace("[email]", "[email protected]");
                html = html.Replace("[name]", "Subscriber Name");
                renderResult.MessageBody = html;
            }
    

    I always tend to recommend that you send a "real" send out to a "real" list (with test-emails) when you build your custom render tasks.

    Cheers!

    // m

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Aug 03, 2015 @ 14:29
    Markus Johansson
    1

    And =D I'll make sure to improve the documentation about this as well. Thank you for making me aware.

Please Sign in or register to post replies

Write your reply to:

Draft