// attachments
Element attachmentsElement = XmlUtil.element(element, "attachments");
if (attachmentsElement != null) {
for (Element attachmentElement : XmlUtil.elements(attachmentsElement, "attachment")) {
AttachmentTemplate attachmentTemplate = new AttachmentTemplate();
mailTemplate.addAttachmentTemplate(attachmentTemplate);
attachmentTemplate.setUrl(XmlUtil.attribute(attachmentElement, "url"));
attachmentTemplate.setResource(XmlUtil.attribute(attachmentElement, "resource"));
attachmentTemplate.setFile(XmlUtil.attribute(attachmentElement, "file"));
}
}
return mailTemplate;
}