Add custom querystring to links in ProcessUniqItem
I'd like to insert a custom unsubscribe and edit profile link in my newsletter. So I have overridden ProcessUniqItem in which I get the subscriber ID from our custom table using the email address and replace a couple of placeholders with the querystring part of the appropriate URL. It doesn't seem to be replacing the placeholder however.
My placeholders are like this, links selected using the insert anchor popup with the placeholder added to the end of the URL.
<a href="/aboutour-pragency/prnews/news-registration.aspx[EDIT_LINK]" title="News Registration">edit your profile</a>
ProcessUniqItem should then replace [EDIT_LINK] a querystring containing the ID of the subscriber. But it doesn't seem to be.
I noticed tracking is added to links, could this be preventing my code from replacing the text.
All rendertasks happens in the order they are sorted inside web.config, It would be best to add this custom task before adding the clicktracking. If that's not possible you have to match on the url-converted values.
Like this:
html = html.Replace(HttpUtility.UrlEncode("[email]"), HttpUtility.UrlEncode(emailTrackingItem.Email));
Its a good idea to set a breakpoint in the code and hook in to the webserver process, that way you can debug your rendertask to maske sure that everything works as expected.
Another thing to concider is the fact that this will perform and database call for each email which may slow down the send out process, make sure to really clean up all resources used by you custom render task.
Url encoding and moving the render task worked. Thanks.
I'm also going to look for another solution to hitting the database every email. Right now I'm just trying to get it working and since we only have around 20 subscribers that will do for now.
All render tasks are listed in the web.config-file "/umbraco/newsletterstudio/web.config". I quess you could comment out the task for the tracking, then Newsletter Studio want run that task. Please be careful when playing aroud, take a backup of you web.config before you start..
Add custom querystring to links in ProcessUniqItem
I'd like to insert a custom unsubscribe and edit profile link in my newsletter. So I have overridden ProcessUniqItem in which I get the subscriber ID from our custom table using the email address and replace a couple of placeholders with the querystring part of the appropriate URL. It doesn't seem to be replacing the placeholder however.
My placeholders are like this, links selected using the insert anchor popup with the placeholder added to the end of the URL.
ProcessUniqItem should then replace [EDIT_LINK] a querystring containing the ID of the subscriber. But it doesn't seem to be.
I noticed tracking is added to links, could this be preventing my code from replacing the text.
Hi!
All rendertasks happens in the order they are sorted inside web.config, It would be best to add this custom task before adding the clicktracking. If that's not possible you have to match on the url-converted values.
Like this:
Its a good idea to set a breakpoint in the code and hook in to the webserver process, that way you can debug your rendertask to maske sure that everything works as expected.
Another thing to concider is the fact that this will perform and database call for each email which may slow down the send out process, make sure to really clean up all resources used by you custom render task.
Url encoding and moving the render task worked. Thanks.
I'm also going to look for another solution to hitting the database every email. Right now I'm just trying to get it working and since we only have around 20 subscribers that will do for now.
Great! Theres no need to avoid it, just want to make you avare of the fact! =D
Nice to hear that you are using the render tasks! =D
One more little query. Is there a way to stop the tracking starting with a ?.
The tracking is appended onto my URL but as I've added a querystring there is already a ? in it.
Hi!
All render tasks are listed in the web.config-file "/umbraco/newsletterstudio/web.config". I quess you could comment out the task for the tracking, then Newsletter Studio want run that task. Please be careful when playing aroud, take a backup of you web.config before you start..
// M
is working on a reply...