Issues with regular expression in invitation emails

More
6 months 2 weeks ago #155229 by arpsh
arpsh created the topic: Issues with regular expression in invitation emails
I have an interesting problem - it might just be lack of knowledge, but it has me stumped!

The SMTP provider we use has started to add footers to our emails unless we have an unsubscribe link that matches their specification. Unfortunately, this is in the form of a regular expression, which Limesurvey doesn't recognise, which obviously breaks the optout link!

Original format:
<a href="{OPTOUTURL}">unsubscribe</a>.

Required format:
<a href="{unsubscribe:{OPTOUTURL}}">unsubscribe</a>.


Does anyone have any ideas how to get aorund this conundrum, for example to pass curly braces as text rather than as an expression?

Any advice greatly appreciated :)

Please Log in to join the conversation.

More
6 months 2 weeks ago #155230 by tpartner
tpartner replied the topic: Issues with regular expression in invitation emails
If you insert a space after the opening brace and before the closing brace, Expression Manager shouldn't parse them.

I'm not sure whether the SMTP provider will recognize this but try:

<a href="{ unsubscribe:{OPTOUTURL} }">unsubscribe</a>.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: arpsh

Please Log in to join the conversation.

More
6 months 2 weeks ago #155235 by arpsh
arpsh replied the topic: Issues with regular expression in invitation emails
Thanks Tony

Unfortunately, it looks like they don't parse it, but it was a good idea nonetheless.

What a silly little problem, but I suspect it might be intractable.

Cheers

Please Log in to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #155238 by DenisChenu
DenisChenu replied the topic: Issues with regular expression in invitation emails
Hi, about
{OPTOUTURL}
are replaced by
<a href="http://urltounsibsribe">http://urltounsibsribe</a>
. Then you mus use
<a href="@@OPTOUTURL@@">unsubscribe</a>

Maybe you can try
<a href="{html_entity_decode(&#123;)}unsubscribe:@@OPTOUTURL@@{html_entity_decode(&#125;)}">unsubscribe</a>

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 6 months 2 weeks ago by DenisChenu.
The following user(s) said Thank You: arpsh

Please Log in to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #155243 by tpartner
tpartner replied the topic: Issues with regular expression in invitation emails
I don't think that will solve it - the issue is that the SMTP provider needs to see a tag enclosed in curly braces but EM is trying to parse those braces.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 6 months 2 weeks ago by tpartner.

Please Log in to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #155244 by arpsh
arpsh replied the topic: Issues with regular expression in invitation emails
Yes, I can confirm that Limesurvey sees both:
{html_entity_decode(&#123;)}

or
&#123;

as curly braces that it tries (unsuccesfully) to decode.


There seems to be no way to pass the curly braces as simple text without Limesurvey pricking up its ears and taking an interest (unlike for example Excel, where you can pass a wildcard character 'as is' by surrounding it by two other wildcards), at least no way I have been able to find via google!
Last Edit: 6 months 2 weeks ago by arpsh.

Please Log in to join the conversation.

More
6 months 2 weeks ago #155245 by arpsh
arpsh replied the topic: Issues with regular expression in invitation emails
With a push in the right direction from Tony and Denis, I think I might have sorted it - hurrah!

I ended up just trying it with simple escaped brackets on the open and close, which Ididn't expect to work, but it did:
<a href="\{unsubscribe:@@OPTOUTURL@@\}">unsubscribe</a>

Thanks to you both!

Please Log in to join the conversation.

More
6 months 2 weeks ago #155246 by tpartner
tpartner replied the topic: Issues with regular expression in invitation emails
That's a good tip to know.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
6 months 2 weeks ago #155247 by DenisChenu
DenisChenu replied the topic: Issues with regular expression in invitation emails
Arg,

Expression Manager of limesurvey replace {html_entity_decode({)} by { and redo the it after ... Must fix this issue ! But \{unsubscribe:@@OPTOUTURL@@\} seems great too.

Maybe manual must be updated ... :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!