Class MailResources
java.lang.Object
de.aikiit.mailversendala.template.MailResources
Validates and snapshots local mail resources once per run. No network resolver is used.
Files are kept in memory so later filesystem changes cannot change a validated message.
-
Constructor Summary
ConstructorsConstructorDescriptionMailResources(MailConfig configuration) Load configured, comma-separated attachments relative to the real template directory. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(org.apache.commons.mail2.jakarta.HtmlEmail email, MailTemplate template) Embed local images using Content-IDs and add ordinary downloadable attachments.voidvalidate(MailTemplate template) Validate every inline image in a rendered message before the first delivery.
-
Constructor Details
-
MailResources
Load configured, comma-separated attachments relative to the real template directory.- Parameters:
configuration- template directory and attachment references.- Throws:
IOException- if a configured file is inaccessible or outside the directory.
-
-
Method Details
-
validate
Validate every inline image in a rendered message before the first delivery.- Parameters:
template- rendered message bodies.- Throws:
IOException- for missing, external, unsupported or escaping image references.
-
applyTo
public void applyTo(org.apache.commons.mail2.jakarta.HtmlEmail email, MailTemplate template) throws org.apache.commons.mail2.core.EmailException Embed local images using Content-IDs and add ordinary downloadable attachments.- Parameters:
email- configured outgoing message.template- rendered HTML and plain-text alternatives.- Throws:
org.apache.commons.mail2.core.EmailException- if resource validation or MIME construction fails.
-