Monday 8 August 2016

How to send notification mail in html format using SendMail activity in TIBCO


1.2      Scenario3 (HTML design format):

We are getting xml response from database/SAP system, according to some filtrations we have to send notification email in html format.

1.2.1          Steps for Resolution:

 

In case we need to send notification mail in html format, then we need to follow the below process.

 

Step 1: Add schema in start to parse employee_list details.


Our final implementation will look like this.


 

Step 2: Create Iteration group for employee (which is repeating element)


 

Step 3: createEmailBody(Mapper):

Using Mapper activity we have to configure table structure what exactly we want to send as notification mail.

 


Input:

Input
Configuration
Email/Body
concat('<html><body><table>',
'<tr><table width="750" border="0" cellpadding="3" cellspacing ="3" ></tr>',
'<tr style="font-family:calibri;font-size:14px;"><td>', $Parse-XML/pfx:empDetails/pfx:employee[$i]/pfx:name, '</td>',
'<td>',$Parse-XML/pfx:empDetails/pfx:employee[$i]/pfx:dept,'</td>',
'<td>',$Parse-XML/pfx:empDetails/pfx:employee[$i]/pfx:phone,'</td>',
'<td>',$Parse-XML/pfx:empDetails/pfx:employee[$i]/pfx:email,'</td>',
'</table></body></html>')

Step 4: MappingEmailStructure(Mapper):

 


 

Input:

Input
Configuration
HTML/header
concat('<html><head/><body>',
'<!-- NOTIFICATION DESCRIPTION --><table width="750" border="0" cellpadding="0">&lf;<tr> &lf;<td style="font-family:calibri;color:black;font-size:16px;">',
'<!-- NOTIFICATION DATA -->&lf;<table width="750" border="0" cellpadding="3" cellspacing ="3" >&lf;<!--TALBE HEADER-->&lf;<tr style="font-family:calibri;color:#009999;font-size:16px;background-color:#CCCCCC;"> &lf;<th colspan=5 align=center>Employee Information</th>&lf;</tr>',
'<tr style="font-family:calibri;color:#009999;font-size:14px;background-color:#CCCCCC;">&lf;<td>Name</td><td>Dept</td><td>Phone</td><td>Email</td></tr>')
HTML/footer
concat('</table>','</body>','</html>')
HTML /Email/Body
Copy-of($accempDetails/AccumulatedOutput/Email)

 

Step 3: Send activity configuration

                           NOTE: Register for a free SMTP Account on smtpcorp.com

                      To send emails from our Tibco process, we need to have SMTP host name, IP address, Username and Password. Using Gmail SMTP for sending email from Tibco profess involves many complexities including STARTTLS errors. So, I decided to use free SMTP service of smtpcorp.com.

 

1.2.2          Test Results (Html format)


 

Send’s notification mail as below format

 

1 comment:

  1. Hi,

    I have tried your example but getting html by mail as .htm and able to see the the html code instead of actual view. Do you have any solution for it.

    ReplyDelete