void composeMessage(final MimeMessageHelper helper,final String textContent,final String htmlContent,final Map<String,byte[]> attachments,final List<String> mailTemplateChain,final String shopCode,final String locale,final String templateName) throws MessagingException, ClassNotFoundException, IOException {
  if (textContent == null || htmlContent == null) {
    if (textContent != null) {
      helper.setText(textContent,false);
    }
    if (htmlContent != null) {
      helper.setText(htmlContent,true);
      inlineResources(helper,htmlContent,mailTemplateChain,shopCode,locale,templateName);
      addAttachments(helper,attachments);
    }
  }
 else {
    helper.setText(textContent,htmlContent);
    inlineResources(helper,htmlContent,mailTemplateChain,shopCode,locale,templateName);
    addAttachments(helper,attachments);
  }
}

void composeMessage ( final MimeMessageHelper helper , final String textContent , final String htmlContent , final Map < String , byte [ ] > attachments , final List < String > mailTemplateChain , final String shopCode , final String locale , final String templateName ) throws MessagingException , ClassNotFoundException , IOException { if ( textContent == null || htmlContent == null ) { if ( textContent != null ) { helper . setText ( textContent , false ) ; } if ( htmlContent != null ) { helper . setText ( htmlContent , true ) ; inlineResources ( helper , htmlContent , mailTemplateChain , shopCode , locale , templateName ) ; addAttachments ( helper , attachments ) ; } } else { helper . setText ( textContent , htmlContent ) ; inlineResources ( helper , htmlContent , mailTemplateChain , shopCode , locale , templateName ) ; addAttachments ( helper , attachments ) ; } }
fill mail message . at least one of the templates must be given .
