void inlineResources(final Mail mail,final String htmlTemplate,final List<String> mailTemplateChain,final String shopCode,final String locale,final String templateName) throws MessagingException, IOException {
  if (StringUtils.isNotBlank(htmlTemplate)) {
    final List<String> resourcesIds=getResourcesId(htmlTemplate);
    if (!resourcesIds.isEmpty()) {
      for (      String resourceId : resourcesIds) {
        final String resourceFilename=transformResourceIdToFileName(resourceId);
        final byte[] content=mailTemplateResourcesProvider.getResource(mailTemplateChain,shopCode,locale,templateName,resourceFilename);
        final MailPart part=mail.addPart();
        part.setResourceId(resourceId);
        part.setFilename(resourceFilename);
        part.setData(content);
      }
    }
  }
}

void inlineResources ( final Mail mail , final String htmlTemplate , final List < String > mailTemplateChain , final String shopCode , final String locale , final String templateName ) throws MessagingException , IOException { if ( StringUtils . isNotBlank ( htmlTemplate ) ) { final List < String > resourcesIds = getResourcesId ( htmlTemplate ) ; if ( ! resourcesIds . isEmpty ( ) ) { for ( String resourceId : resourcesIds ) { final String resourceFilename = transformResourceIdToFileName ( resourceId ) ; final byte [ ] content = mailTemplateResourcesProvider . getResource ( mailTemplateChain , shopCode , locale , templateName , resourceFilename ) ; final MailPart part = mail . addPart ( ) ; part . setResourceId ( resourceId ) ; part . setFilename ( resourceFilename ) ; part . setData ( content ) ; } } } }
add inline resource to mail message . resource id will be interpreted as file name in following fashion : filename_ext .
