Home Forums Newsletter Plugin Support Conditionally render content in a profile page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #11931
    Paul Bakker
    Participant

    Hi Stefano,

    I was working on a shortcode plugin that allows me to render text on a profile page (specifically a download link) if the subscriber has a particular preference.

    The usage would be like:

    [profile_content category="My preference"]Your download is available at http://some.url[/profile_content]
    

    The plugin would then only render the content if the subscriber with id and token (from request) has the given preference.
    But the profile pages that are admininistered in the newsletter plugin do not interpret the shortcode and show it as it appears above.

    Is there a way around this? Is there already a feature for this that I overlooked?

    Best wishes,
    Paul Bakker

    #11934
    Paul Bakker
    Participant

    Never mind, I found the way around. I can pass the id and token from a newsletter to any post on the web site so the shortcode would work on a post like that.

    Paul

    #11937
    Stefano
    Keymaster

    Hi, you’re right the short code are not executed… I need to modify the plugin so it processes the short codes.

    Being the profile text inserted with a short code, WordPress does not manage the short code execution in a recursive manner.

    Bye, Stefano.
    Already tried Nearby Photos? Try it and see what’s happening around you!

    #11940
    Paul Bakker
    Participant

    Hi Stefano,

    In the post that is the html source for the newsletter, I have

    The pdf file is <a href="http://mydomain.org/downloads?nm=profile&mysecret=09ea99c0-b62d-14e4-916f-0440200cca66&nk={id}-{token}">freely available for you online</a> until Monday 6 October.

    The url ends up in the newsletter that I receive as:

    http://mydomain.org/wp-content/plugins/newsletter/statistics/link.php?r=MTE0OzEwMzk1O2M1NDYzNWJjY2Y7

    Why does this relinking take place?

    If I disable “Tracks clicks and message opening?”, the resulting url consists only of my token.

    Best,
    Paul

    #11946
    Stefano
    Keymaster

    That link is there to track the clicks. If you disable the tracking the link should be the original one. Can you explain me better what’s happening?

    #11953
    Paul Bakker
    Participant

    Let’s assume that my id in the wp_newsletter database is 5221 and my token is cafebabe12.

    In the post that is used as the html source for the newsletter I have a hyperlink whose href is
    http://mydomain.org/downloads?nm=profile&mysecret=09ea99c0-b62d-14e4-916f-0440200cca66&nk={id}-{token}

    I added the mysecret request parameter because that is used later by my own plugin as an extra validation. (The “downloads” post contains my shortcode plugin that should then use the mysecret parameter, but I never get that far.)

    If I disable tracking, I expect the url in the hyperlink in the newsletter to be:

    http://mydomain.org/downloads?nm=profile&mysecret=09ea99c0-b62d-14e4-916f-0440200cca66&nk=5221-cafebabe12

    But it is only cafebabe12

    I’m trying to figure out what’s happening in the relink function but you can probably work it out much easier. Can I provide more info?

    Regards,
    Paul

    #11954
    Stefano
    Keymaster

    Ok, so you confirm that EVEN with tracking disabled (so the relink function should never be called) the is and the token are not correctly replaced.

    I look at it asap.

    Bye, Stefano.
    Already tried Nearby Photos? Try it and see what’s happening around you!

    #11955
    Paul Bakker
    Participant

    Correct.

    Many thanks,
    Paul

    #11963
    Paul Bakker
    Participant

    Hi Stefano,

    I noticed that the hyperlink in the post

    http://mydomain.org/downloads?nm=profile&mysecret=09ea99c0-b62d-14e4-916f-0440200cca66&nk={id}-{token}

    is already changed when the email is saved to the emails table.
    It becomes

    {token}

    In includes/module.php there is a line in clean_url_tags($text) that is responsible for this. If I comment that line out, the hyperlink is generated in the newsletter the way I expect it. From your comment I can see that it is there to clean up the url after the editor has turned it into an absolute url, but in my case the absolute url is intentional and should not be trimmed.

    Best,
    Paul

    #12015
    Paul Bakker
    Participant

    Thanks for fixing it in the latest release.

    Best,
    Paul

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.