As the title says, I’m sending a link to sendgrid API but when I receive the email and click the link it uses + instead of %20 and the server won’t recognize it as a link
Are you using spaces in your links?
There is no embedded URL encoding within Wappler, but you can use this to manually replace when creating the link.
{{$_POST.eMail.replace("+", "%2B")}}
Thanks, but it’s not working…
In bubble I could make it work using the URL Encoded format, check the screenshot
Here is the data in the JSON script
{{$_POST.periodo.uppercase().replace('+','%20')}}
Are you saying what I provided didn’t work? I said use %2B but you are showing %20.
I tried both, %2B and %20, it keeps showing the +
Maybe you should post what you are sending, and what is coming back. The code I provided works fo me and enables the use of a plus sign in a url. If you are dealing with something else, the solution will be different.
@salvuccicarlos
%20
corresponds to an empty space. Are you sure you know what you need to achieve and what you are doing?
All empty spaces on my URL somehow are being send to sendgrid replacing the empty spaces with an + instead of %20.
I tried the url with %2B and won’t work either
So HOW do you expect your link to be sent? Can you post the exact link being sent now and the link which you would like to have?
This is the link I get when the mail is sent
https://www.estudiobts.com.ar/expensas/1/ENERO+2019/EXPENSAS+ENERO+2019-1001.pdf
This is how the link works on my VPS
https://www.estudiobts.com.ar/expensas/1/ENERO%202019/EXPENSAS%20ENERO%202019-1001.pdf
Are you sending this using a server connect form and POST variables?
Is inside the server connect action, in the JSON document that is send to sendgrid.
This is the code:
{
"personalizations": [
{
"to": [
{
"email": "{{Correo_Lista}}"
}
],
"dynamic_template_data": {
"edificio": "{{$parent.edificio.direccion}}",
"periodo": "{{$_POST.periodo}}",
"departamento": "{{unidad}}",
"saldo": "{{SaldoExpensa}}",
"vencimiento": "{{$_POST.vencimiento}}",
"notas": "{{$_POST.texto}}",
"pdf": "https://www.estudiobts.com.ar/expensas/{{$_POST.edificio}}/{{$_POST.periodo.uppercase().replace('+','%2B')}}/EXPENSAS%2B{{$_POST.periodo.uppercase().replace('+','%2B')}}-{{propietari}}.pdf"
}
}
],
Solved it, the problem was that the value did not have a + it had a space, so I replace the ' '
for '%20'
.
Thanks everybody!