RM Partner
RM Partner

Send Mail with Data

Hello All,


There is a couple of similar posts but no proper answer given so I wanted to take my chance. 

I am trying to use Send Mail operator with macro. 

Form what I get is you are able to send data value if you specify attribute and index. So if one has 1 value to send, things are easy.

However I have a process that outputs 2 rows of data table and I would like to send the both values in the same email.

To be more specific my data is like:






and I am trying to send an email like:


Dear receiver,

Problematic machines are:




The thing is this needs to be generic, I might not always have 2 values so hardcoding 2 is not an option. I feel like I need the loop operator and it will count total number of rows and create an array of values in the form of a macro.

But I couldn't figure out how to do that (if possible).


Any help is highly appreciated.





RM Staff
RM Staff

Re: Send Mail with Data



give us a week or two. If this is not an option, write me a PM and i can give you a two operator solution.



Head of Data Science Services at RapidMiner
RM Certified Expert
RM Certified Expert

Re: Send Mail with Data

Here's a lazy solution.


<?xml version="1.0" encoding="UTF-8"?><process version="7.3.000">
  <operator activated="true" class="process" compatibility="7.3.000" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="generate_data_user_specification" compatibility="7.3.000" expanded="true" height="68" name="Generate Data by User Specification" width="90" x="112" y="85">
        <list key="attribute_values">
          <parameter key="M_0212" value="&quot;Very Broken&quot;"/>
          <parameter key="M_0221" value="&quot;Super Faulty&quot;"/>
        <list key="set_additional_roles"/>
      <operator activated="true" class="transpose" compatibility="7.3.000" expanded="true" height="82" name="Transpose" width="90" x="112" y="187"/>
      <operator activated="true" class="write_csv" compatibility="7.3.000" expanded="true" height="82" name="Write CSV" width="90" x="246" y="187">
        <parameter key="column_separator" value="|"/>
        <parameter key="quote_nominal_values" value="false"/>
      <operator activated="true" class="text:read_document" compatibility="7.3.000" expanded="true" height="68" name="Read Document" width="90" x="179" y="340"/>
      <operator activated="true" class="text:documents_to_data" compatibility="7.3.000" expanded="true" height="82" name="Documents to Data" width="90" x="179" y="442">
        <parameter key="text_attribute" value="fault"/>
      <operator activated="true" class="extract_macro" compatibility="7.3.000" expanded="true" height="68" name="Extract Macro" width="90" x="380" y="493">
        <parameter key="macro" value="thisFaultBad"/>
        <parameter key="macro_type" value="data_value"/>
        <parameter key="attribute_name" value="fault"/>
        <parameter key="example_index" value="1"/>
        <list key="additional_macros"/>
      <operator activated="true" class="text:create_document" compatibility="7.3.000" expanded="true" height="68" name="Create Document" width="90" x="447" y="340">
        <parameter key="text" value="Hey there,&#10;&#10;You know you have a problem with your machine.  &#10;&#10;%{thisFaultBad}&#10;&#10;Totes wanted to let you know.  &#10;&#10;See ya!"/>
      <connect from_op="Generate Data by User Specification" from_port="output" to_op="Transpose" to_port="example set input"/>
      <connect from_op="Transpose" from_port="example set output" to_op="Write CSV" to_port="input"/>
      <connect from_op="Write CSV" from_port="file" to_op="Read Document" to_port="file"/>
      <connect from_op="Read Document" from_port="output" to_op="Documents to Data" to_port="documents 1"/>
      <connect from_op="Documents to Data" from_port="example set" to_op="Extract Macro" to_port="example set"/>
      <connect from_op="Create Document" from_port="output" to_port="result 1"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
-- Training, Consulting, Sales in China, Hong Kong & Taiwan --
Twitter Feed