Home › Forums › Newsletter Plugin Support › Conditionally render content in a profile page
- This topic has 9 replies, 2 voices, and was last updated 8 years, 8 months ago by
Paul Bakker.
-
AuthorPosts
-
September 26, 2014 at 11:33 pm #11931
Paul Bakker
ParticipantHi 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 BakkerSeptember 27, 2014 at 9:41 am #11934Paul Bakker
ParticipantNever 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
September 27, 2014 at 7:09 pm #11937Stefano
KeymasterHi, 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!September 28, 2014 at 10:28 am #11940Paul Bakker
ParticipantHi 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,
PaulSeptember 28, 2014 at 5:50 pm #11946Stefano
KeymasterThat 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?
September 28, 2014 at 10:15 pm #11953Paul Bakker
ParticipantLet’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:
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,
PaulSeptember 28, 2014 at 10:37 pm #11954Stefano
KeymasterOk, 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!September 28, 2014 at 10:49 pm #11955Paul Bakker
ParticipantCorrect.
Many thanks,
PaulSeptember 29, 2014 at 10:42 pm #11963Paul Bakker
ParticipantHi 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,
PaulOctober 7, 2014 at 10:36 pm #12015Paul Bakker
ParticipantThanks for fixing it in the latest release.
Best,
Paul -
AuthorPosts
- You must be logged in to reply to this topic.