Simple macro needed

Jon Hollis asked on January 15, 2015 13:30

Hi,

We've got several forms pulling out a multi-select list from a database, each with a different email address. The input values are looking something like this:

value="string *email@domain.com"

and then the MultipleChoiceControl will look like this after the form is submitted:

string1 *email1@domain.com|string2 *email2@domain.com|string3 *email3@domain.com

I want a macro, or the regex to use, to replace the | with ; and remove all the strings ie:

email1@domain.com;email2@domain.com;email3@domain.com

The macro will go in a form email to notification field and will look something like this:

{% RegexReplace(Replace(MultipleChoiceControl,"|",";"),@REGEX,"") %}

We're using Kerntico 8.16.

Cheers, Jon.

Recent Answers


Virgil Carroll answered on January 15, 2015 20:46

Here is how to create your own custom macro to do this: https://docs.kentico.com/display/K8/Registering+custom+macro+methods

0 votesVote for this answer Mark as a Correct answer

Jon Hollis answered on January 16, 2015 11:55

Thanks. This is much better than trying to work out the regex.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.