Added attachments to templates

This commit is contained in:
M66B
2024-06-16 10:29:15 +02:00
parent 18666c4b5e
commit f399facb00
10 changed files with 222 additions and 95 deletions

View File

@@ -326,7 +326,8 @@ public class ServiceExternal extends ServiceBase {
new InternetAddress(identity.get(0).email, identity.get(0).name, StandardCharsets.UTF_8.name())};
if (subject == null) // Allow empty string
subject = answers.get(0).name;
String body = answers.get(0).getHtml(context, to);
EntityAnswer.Data answerData = answers.get(0).getData(context, to);
String body = answerData.getHtml();
EntityMessage msg = new EntityMessage();
msg.account = identity.get(0).account;
@@ -356,6 +357,8 @@ public class ServiceExternal extends ServiceBase {
msg.preview,
null);
answerData.insertAttachments(context, msg.id);
EntityOperation.queue(context, msg, EntityOperation.SEND);
ServiceSend.start(context);
}