Spaces in variable URL
Posted: Thu Sep 07, 2023 4:12 pm
I'm using Switch to generate a html-mail containing a button with a URL for the user to click on. This works fine, but if the receiver will forward this e-mail, the URL-link might get lost depending on which e-mail application is used and the users local settings.
To compensate for this I also include the URL as a text string so the user can copy this and paste it in his webbrowser. That works fine as well ..for the most.
The URL is dynamically generated based on metadata from the job i Switch. Sometimes that metadata string will contain spaces (could be a users first and last name). In that case the URL text-string is broken.
I'm aware that in a URL a space is supposed to be %20, but since the data comes from a variable I don't see any way to automatically replace the spaces with %20.
I'm far from an expert in html, so I wonder if anybody has a solution for this challenge.
To compensate for this I also include the URL as a text string so the user can copy this and paste it in his webbrowser. That works fine as well ..for the most.
The URL is dynamically generated based on metadata from the job i Switch. Sometimes that metadata string will contain spaces (could be a users first and last name). In that case the URL text-string is broken.
I'm aware that in a URL a space is supposed to be %20, but since the data comes from a variable I don't see any way to automatically replace the spaces with %20.
I'm far from an expert in html, so I wonder if anybody has a solution for this challenge.