If a parameter is left empty, no filter is applied.
The `transformation` is applied before setting the channel status.
-Transformations can be chained by separating them with the mathematical intersection character "∩", e.g. `REGEX:.*Shipment-Status: ([a-z]+).*∩MAP:status.map` would first extract a character string with a regular expression and then apply the given MAP transformation on the result.
+Transformations are defined using this syntax: `TYPE(FUNCTION)`, e.g.: `JSONPATH($.path)`.
+The syntax: `TYPE:FUNCTION` is still supported, e.g.: `JSONPATH:$.path`.
+Transformations can be chained in the UI by listing each transformation on a separate line, or by separating them with the mathematical intersection character "∩".
+For example, `REGEX(.*Shipment-Status: ([a-z]+).*) ∩ MAP(status.map)` would first extract a character string with a regular expression and then apply the given MAP transformation on the result.
Please note that the values will be discarded if one transformation fails (e.g. REGEX did not match).
This means that you can also use it to filter certain emails e.g. `REGEX:(.*Sendungsbenachrichtigung.*)` would only match for mails containing the string "Sendungsbenachrichtigung" but output the whole message.
*/
package org.openhab.binding.mail.internal.config;
+import java.util.List;
+
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
public @Nullable String folder;
public String subject = "";
public String sender = "";
- public @Nullable String transformation;
+ public @Nullable List<String> transformation;
public boolean markAsRead = false;
}
channel-type.config.mail.content.subject.label = Subject Filter
channel-type.config.mail.content.subject.description = A (regular expression) filter for the mail subject.
channel-type.config.mail.content.transformation.label = Transformation
-channel-type.config.mail.content.transformation.description = Transformation pattern used when processing messages. Multiple transformation can be chained using "∩".
+channel-type.config.mail.content.transformation.description = Transformation pattern used when processing messages. Multiple transformations can be chained by listing each transformation on a separate line, or by concatenating them with "∩".
channel-type.config.mail.mailcount.folder.label = Folder Name
channel-type.config.mail.mailcount.type.label = Counter Type
channel-type.config.mail.mailcount.type.option.UNREAD = Unread
<label>Sender Filter</label>
<description>A (regular expression) filter for the mail sender address.</description>
</parameter>
- <parameter name="transformation" type="text">
+ <parameter name="transformation" type="text" multiple="true">
<label>Transformation</label>
- <description>Transformation pattern used when processing messages. Multiple transformation can be chained using "∩".</description>
+ <description>Transformation pattern used when processing messages. Multiple transformations can be chained by
+ listing
+ each transformation on a separate line, or by concatenating them with "∩".</description>
</parameter>
<parameter name="markAsRead" type="boolean">
<label>Mark As Read</label>