cancel
Showing results for 
Search instead for 
Did you mean: 

E-mail template using Guided Procedure

Former Member
0 Kudos
80

Hi Experts,

I have created the Email callable object and then created e-mail template using HTML Template then assigned to email callable object. In that E-mail template I can change the content dynamically but I am not able to change the subject line dynamically. Is it possible to change subject line dynamically based on action in e-mail template using e-mail callable object.

Please guide me.

Thanks & Regards,

Sundaresan.B

View Entire Topic
yogesh_galphade
Contributor
0 Kudos

hi

why you are creating the callable object, you can simply send the mail at the end of execute method using this code;

 
public void sendMailtoHR( )
  {
    //@@begin sendmail()
	try 
	  {    
		   String strSMTPIPAddress ="152.63.1.200";
		   Properties props;
		   Session session;
		   Provider p;
		   props = System.getProperties();			
		   props.put("mail.smtp.host", strSMTPIPAddress);
		   session = Session.getDefaultInstance(props, null);
		   p = session.getProvider("smtp");
		   strMailBody  = new StringBuffer();
		   generateMailbody(strMailBody);
		   Message message = new MimeMessage(session);			
		   message.setFrom(new InternetAddress("mailid"));
		   message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailid));
		   message.setSubject("Employee Resignation Request"); 		
		   message.setText(strMailBody.toString());		
		   Transport.send(message);		
		}//try    
		catch (Exception e)
		{ 
		   wdComponentAPI.getMessageManager().raiseException("Exception in sendmail" + e.getMessage(), true); 
		}

    //@@end
  }