Send Email without an email template

Which IIQ version are you inquiring about?

Version 8.4

Share all details related to your problem, including any error messages you may have received.

Hello,
I am trying to send an email from a rule. In the past I have been able to use emailOptions.setBody () and emailOptions.setSubject() to set a body and subject but looks like I cant do that anymore. I am getting an error when I use those methods. Is there a way to achieve this?

below one works on 8.3p3

  EmailTemplate template = new EmailTemplate();
  EmailOptions options = new EmailOptions("email address",null);
  template.setBody("test!!!") ;
  template.setSubject("test email without emailtemplate") ;
  context.sendEmailNotification(template, options);

I have tested below in 8.4 it works fine. Please check.

EmailTemplate template = context.getObject(EmailTemplate.class, "ABC TEST");
  
  //EmailTemplate template = new EmailTemplate();
  EmailOptions options = new EmailOptions("email address",null);
  template.setBody("test!!!") ;
  template.setSubject("test email without emailtemplate") ;
  context.sendEmailNotification(template, options);

@HemantSingh . Thanks so much. I realize I was passing body and Subject to the emailOptions constructor and not to the template constructor.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.