diff --git a/ReflexUtils.ftl b/ReflexUtils.ftl index d1e2569..a73c1fa 100644 --- a/ReflexUtils.ftl +++ b/ReflexUtils.ftl @@ -10,17 +10,18 @@ <#-- Split email reflex into json array string --> <#-- Example : splitemail "john.doe@hardis-group.com,; name@hardis-group.com" --> <#-- return "["john.doe@hardis-group.com","name@hardis-group.com"]" --> -<#-- ${splitEmailsIntoArray(emailReflex)} --> <#-- --------------------------------------------------------------------------------------- --> <#function splitEmailsIntoArray emails > <#local str = "["> -<#list emails?split(';|,| ',"r")?filter(l -> l != "") as email> +<#list emails?split(";|,| |à|/","r")?filter(l -> l != "") as email> +<#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")> <#if str != "["> <#local str += ","> <#local str += "\""> <#local str += email> <#local str += "\""> + <#local str += "]"> <#return (str)>