Modifs emalis 1601241352
This commit is contained in:
parent
12e29c6644
commit
c7fbfe21fb
@ -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 += ",">
|
||||
</#if>
|
||||
<#local str += "\"">
|
||||
<#local str += email>
|
||||
<#local str += "\"">
|
||||
</#if>
|
||||
</#list>
|
||||
<#local str += "]">
|
||||
<#return (str)>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user