Send Email Smart Service

Certified Associate Developer

Hi Community,

I am just trying all scenarios related to send email smart servce though my environment.

I need to add process report to body of the email. Could you help me 

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Associate Developer

    Hi
    As per my doings,
    We can't directly call a rule in mail
    So we have to do through HTML.


    1.Create a HTML template with tables (refer html format of how to create tables)

    2.Get the report data by using queryprocessanalytics

    3.Loop the data for HTML code.

    4.When configuring email select email template and select the template you created.

    Refer the code:-
    concat(
    "
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
    }
    </style>
    </head>
    <body>
    ",
    a!forEach(
    items: ri!queryprocessanalyticsData,
    expression: "
    <table style=width:100%>
    <tr>
    <th>C0</th>
    <th>C1</th>
    <th>C2</th>
    <th>C3</th>
    </tr>
    <tr style="&char(34)&"text-align:center"&char(34)&">
    <td><a href="&ri!links[fv!index]&">"&fv!item.C0&"</td>
    <td>"&fv!item.C1&"</td>
    <td>"&fv!item.C2&"</td>
    <td>"&fv!item.C3&"</td>
    </tr>
    </table>"
    ),
    "</body>
    </html>"
    )

  • 0
    Certified Associate Developer
    in reply to Teja Kunchala

    concat(
    "
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
    }
    </style>
    </head>
    <body>
    ",
    a!forEach(
    items: rule!RF_getProcessREportData(),
    expression: "
    <table style=width:100%>
    <tr>
    <th>C0</th>
    <th>C1</th>
    <th>C2</th>
    <th>C3</th>
    </tr>
    <tr style=" & char(34) & "text-align:center" & char(34) & ">
    <td>" & fv!item.C0 & "</td>
    <td>" & fv!item.C1 & "</td>
    <td>" & fv!item.C2 & "</td>
    <td>" & fv!item.C3 & "</td>
    </tr>
    </table>"
    ),
    "</body>
    </html>"
    )

    In the rule I have this code  

    a!queryProcessAnalytics(
      report: cons!RF_PROCESS_REPORT,
      contextProcessModels: cons!RF_PROCESS_MODEL,
      query: a!query(
        pagingInfo: a!pagingInfo(startIndex: 1, batchSize: - 1)
      )
    ).data

    Result is like this

  • 0
    Certified Associate Developer
    in reply to JPotharaju

    Hi
    Use the forloop after </tr> before <tr style=" & char(34) & "text-align:center" & char(34) & "> and check the data is there in process report or not

Reply Children
No Data