Copied to clipboard

Flag this post as spam?

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


  • ewuski 97 posts 263 karma points
    May 08, 2024 @ 17:21
    ewuski
    0

    Issues inserting a content link with params in email template

    Umbraco 10.8.3, NS 10.0.14

    Following various fixes described here:

    1. Fix to utm_content: https://our.umbraco.com/packages/backoffice-extensions/newsletter-studio-the-email-studio/comments/113075-google-analytics-tracking-issue

    2. Fix to transactional emails operating in a loop described here: https://our.umbraco.com/packages/backoffice-extensions/newsletter-studio-the-email-studio/comments//113804-transactional-email-in-a-loop-not-working

    3. Support for merge fields in query string described here: https://our.umbraco.com/packages/backoffice-extensions/newsletter-studio-the-email-studio/comments/113252-how-to-add-merge-fields-to-button-or-text-link-param-in-email-template

    we keep testing the transactional email feature.

    We noticed new issues:

    Issue 1.

    When we add more than one param in a query string when inserting a link in an email body, the query gets encoded and & converts into &amp%3B. This means the subsequent query parameters (except the first one) are not read correctly by the target.

    We've been testing transactional emails but this is likely affecting campaign emails as well.

    Eg. we add a query to a URL:

    utm_content=body&br=aaa
    

    This results in a query string as:

    ?utm_content=body&amp%3Bbr=....
    

    so br param is not recognised by the target.

    Steps to replicate:

    1. Design an email: add a Text control.

    2. Add a link in the Text control and select an existing content page as a target.

    3. After selecting the target, add a query string in the Anchor/Query string field that contains two params at least, eg: utm_content=body&br=aaaa

    enter image description here

    1. Save the template.

    2. Send the email(s) and check the link target.

    3. The target url comes with params with & encoded, eg.

      ?utm_content=body&amp%3Bbr=

    Issue 2.

    If there is a merge field as a query string param, an error occurs when reading the anchor target on edit.

    Follow the points 1-4 above with an exception that instead of hardcoded param values add at least one that contains a merge field:

    utm_content=body&br={ref}
    
    1. Go back to edit the Text control you've just added. Click to edit the link.

    2. Two errors display as the anchor is unable to find the target page selected:

    enter image description here

    The Link field now displays the target page UDI instead of the target path:

    enter image description here

    The issue does not occur if no param with a merge field exists in the Query string.

    Issue 3:

    The RTE icons are not displaying when adding a Text control to a campaign or email:

    enter image description here

    This looks like an issue related to NS version as we have NS version 10.0.13 on production where the icons work correctly though locally we have installed version 10.0.14 (following the fix described here: https://our.umbraco.com/packages/backoffice-extensions/newsletter-studio-the-email-studio/comments//113804-transactional-email-in-a-loop-not-working) and the icons are gone.

  • Markus Johansson 1924 posts 5831 karma points MVP 2x c-trib
    May 08, 2024 @ 20:48
    Markus Johansson
    0

    Hi!

    Let's take them one by one.

    Issue 1

    I can confirm this on Umbraco 10.8.5, I'm not sure when this was introduced but it seems like the rich text editor (TinyMce) is encoding the &-signs. Could be a Tiny-upgrade or some setting.

    If you're sending a transactional email I would recommend putting the whole URL into model/merge field so that you only need

    <a href="{mergeField}">Link</a>
    

    I need to back track when this started to surface and provide a was to handle it in the package. Keep you posted.

    Issue 2

    If I understand your here right you're having problem adding a link with a merge field from the link picker in the Rich Text Editor?

    This is a bug in Umbraco and a PR was submitted that has been merged into Umbraco 13.1.0.

    Please see the link from the forum-thread you linked to: https://github.com/umbraco/Umbraco-CMS/pull/15513

    If you need links that is dynamic my recommendation is include the full link as as a merge fields or insert them in the transactional email model, this way you can also ensure that the link is not "tampered" with by mistake from any editor.

    Issue 3:

    The upgrade between 10.0.13 to 10.0.14 was only a very small change in the C# code so it has to be related to something other then the package. Did you try to reset browser cache, clear any smidge cache etc?

    Do you see any javascript errors in the console?

    It works on a clean install:

    enter image description here

    Cheers!

  • Markus Johansson 1924 posts 5831 karma points MVP 2x c-trib
    May 08, 2024 @ 21:53
    Markus Johansson
    0

    Hi again!

    Reg. Issue 1.

    I've just released a fix for the issue with the encoded ampersands,

    Should be a simple upgrade from 10.0.14 to 10.0.15:

    https://www.nuget.org/packages/NewsletterStudio/10.0.15

    https://www.newsletterstudio.org/versions/10/

    Same fix will be applied to other versions of the package as well, look at the version history here:

    https://www.newsletterstudio.org/versions/

    // Markus

  • ewuski 97 posts 263 karma points
    27 days ago
    ewuski
    0

    Issue 1. Resolved with version 10.0.15

    Issue 2. We are still to upgrade to U13. However, the issue does not prevent links from rendering correctly in the email body.

    Issue 3. Resolved. Not sure what it was?

    Thanks for quick help!

  • ewuski 97 posts 263 karma points
    27 days ago
    ewuski
    0

    I'm afraid I discovered another issue :(

    Let's say I am inserting a merge field with the following value:

    YWRhZGYtYWNkYWYgYWRzZmOhIGFmYWY==

    or

    d3N6eXNjeXpuYWpvbWlrcm9saWthLOo4M1ZSRA==

    This is an encrypted string and they often have single or double equal marks at the end.

    The correct value of the model property is being passed to the transactional email.

    If I put this value in the email body as ad text, it shows correctly as above.

    If I add this value as a URL param, eg.

    someurl?qs={{encryptedParam}}
    

    which should resolve respectively to:

    someurl?qs=YWRhZGYtYWNkYWYgYWRzZmOhIGFmYWY==

    someurl?qs=d3N6eXNjeXpuYWpvbWlrcm9saWthLOo4M1ZSRA==

    and click the link in the received email body, I get the following in my browser:

    someurl?qs=YWRhZGYtYWNkYWYgYWRzZmOhIGFmYWY

    someurl?qs=d3N6eXNjeXpuYWpvbWlrcm9saWthLOo4M1ZSRA

    That means, the bit at the end: "==" is getting stripped from the value which causes the value to be incorrect when requested at the target URL.

    Btw I understand the suggestion to replace the entire URL with a merge field. However, in this case, we would need to create a transaction model that holds a property and equivalent merge field for every possible URL that uses the param and that we may add to the email. That's not very maintainable and limits a lot the flexibility we gain in creating email templates with NS.

  • Markus Johansson 1924 posts 5831 karma points MVP 2x c-trib
    24 days ago
    Markus Johansson
    0

    Hi!

    Issue 1

    Great.

    Issue 2

    This is a bug in Umbraco so it's out of our control. See the linked issue. The problem is in how Umbraco stores the selected content inside the RTEs markup.

    Since the value is stored in the wrong way, we can't do anything about it.

    Your best option is to upgrade Umbraco or to use a merge field that holds the full URL.

    Issue 3

    Great!

    Issue 4

    I need to look closer at why these are removed from the query string, as far as I know, we're using the .NET native stuff to parse the query string.

    Are you on version 10.0.15 now?

    A good solution would be to adjust your algorithm to use base62 encoding or even better base32 to avoid special characters in the URL.

    https://en.wikipedia.org/wiki/Base62#:~:text=The%20base62%20encoding%20scheme%20uses,in%20an%20ASCII%20string%20format.

    I'll keep you posted about this issue.

Please Sign in or register to post replies

Write your reply to:

Draft