emiliosetiadarma commented on code in PR #6204:
URL: https://github.com/apache/nifi/pull/6204#discussion_r921706220


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java:
##########
@@ -523,4 +555,57 @@ private InternetAddress[] toInetAddresses(final 
ProcessContext context, final Fl
     protected void send(final Message msg) throws MessagingException {
         Transport.send(msg);
     }
+
+    /**
+     * Utility function to return a Map of optional {@code mail._____} 
properties that were set dynamically.
+     * @param context the ProcessContext
+     * @return a Map with optional {@code mail._____} properties
+     */
+    private Map<String, String> getDynamicMailProperties(final ProcessContext 
context) {
+        final Map<String, String> dynamicMailProperties = new HashMap<>();
+
+        for (final Map.Entry<PropertyDescriptor, String> entry: 
context.getProperties().entrySet()) {
+            final PropertyDescriptor descriptor = entry.getKey();
+            if (descriptor.isDynamic()) {
+                final String name = descriptor.getName();
+                final Matcher matcher = MAIL_PROPERTY_PATTERN.matcher(name);
+                if (matcher.matches()) {
+                    dynamicMailProperties.put(name, entry.getValue());
+                }
+            }
+        }
+
+        return dynamicMailProperties;
+    }

Review Comment:
   Oh yeah my bad forgot to remove this from my first implementation, removing 
it now!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to