开发者

sending sentences in url

This is an odd question but hopefully someone has an idea of how to work around it

I'm working with a 3rd party product that sends out txt-based emails on the triggering of certain events. I can customize the text of the emails and I开发者_JS百科 have access to certain dynamic properties that I can embed that will be included when the email is generated. So for example assume that I have a dynamic property called %%full-name%%, when it sends the email it would substitute in 'John Smith' in the body of the email.

Now, I need to also embed a url in the email that uses that dynamic property, something like this:

http://mysite.com?fullname=%%full-name%%

but what will happen is that the 3rd party product has no idea I am embedding a link so it doesn't know to escape it for the space between John and Smith so I get this:

http://mysite.com?fullname=John Smith

where the clickable part of the link shows up as just the bolded part in most mail clients.

So my question is, is there a way to wrap that dynamic property such that it will render the link properly despite the spaces? Since its a 3rd party API I'm working with I have zero control over the actual values being passed into the dynamic properties so my options are limited


You should ask the third party vendor this questions. They may have some way of designating that you want a URL encoded dynamic variable in the email.


If you surround the link in quotes ("") or greater/less than (<>), most email clients "like outlook" will know that it represents one link and won't cut it off at the space.

"http://mysite.com?fullname=%%full-name%%"
<http://mysite.com?fullname=%%full-name%%>

You will run into issues if the variable contains other special characters (like: + % & " >).

  • edit * Have you tried using HTML

    <a href="http://mysite.com?fullname=%%full-name%%">http://mysite.com?fullname=%%full-name%%</a>


If you control the data that is available, you could always maintain another property that is url-safe:

Hi, %%full-name%%, visit this link to set your preferences:

http://mysite.com?fullname=%%full-name-url%%"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜