void composeMessage(final Mail mail,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) {
      mail.setTextVersion(textContent);
    }
    if (htmlContent != null) {
      mail.setHtmlVersion(htmlContent);
      inlineResources(mail,htmlContent,mailTemplateChain,shopCode,locale,templateName);
      addAttachments(mail,attachments);
    }
  }
 else {
    mail.setTextVersion(textContent);
    mail.setHtmlVersion(htmlContent);
    inlineResources(mail,htmlContent,mailTemplateChain,shopCode,locale,templateName);
    addAttachments(mail,attachments);
  }
}

void composeMessage ( final Mail mail , 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 ) { mail . setTextVersion ( textContent ) ; } if ( htmlContent != null ) { mail . setHtmlVersion ( htmlContent ) ; inlineResources ( mail , htmlContent , mailTemplateChain , shopCode , locale , templateName ) ; addAttachments ( mail , attachments ) ; } } else { mail . setTextVersion ( textContent ) ; mail . setHtmlVersion ( htmlContent ) ; inlineResources ( mail , htmlContent , mailTemplateChain , shopCode , locale , templateName ) ; addAttachments ( mail , attachments ) ; } }
fill mail message . at least one of the templates must be given .
