Skip to content

Commit

Permalink
Mit Zip Mailer versendete Mails in DB Speichern (#270)
Browse files Browse the repository at this point in the history
* Mit Zip Mailer versendete Mails in DB Speichern

* ZIP Mail Speichern nach senden
  • Loading branch information
lenilsas authored Jul 27, 2024
1 parent 2e75474 commit 2cd0870
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/de/jost_net/JVerein/io/ZipMailer.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Enumeration;
import java.util.Map;
import java.util.TreeSet;
Expand All @@ -37,7 +39,9 @@
import de.jost_net.JVerein.Variable.AllgemeineMap;
import de.jost_net.JVerein.Variable.MitgliedMap;
import de.jost_net.JVerein.Variable.VarTools;
import de.jost_net.JVerein.rmi.Mail;
import de.jost_net.JVerein.rmi.MailAnhang;
import de.jost_net.JVerein.rmi.MailEmpfaenger;
import de.jost_net.JVerein.rmi.Mitglied;
import de.jost_net.JVerein.util.JVDateFormatTTMMJJJJ;
import de.willuhn.jameica.gui.GUI;
Expand Down Expand Up @@ -132,9 +136,27 @@ public void run(ProgressMonitor monitor) throws ApplicationException
monitor.log("Versende an " + mail);
try
{
sender.sendMail(mail, wtext1.getBuffer().toString(),
wtext2.getBuffer().toString(), anhang);
sender.sendMail(mail, wtext1.getBuffer().toString(),
wtext2.getBuffer().toString(), anhang);
sentCount++;

Mail ml = (Mail) Einstellungen.getDBService()
.createObject(Mail.class, null);
ml.setBetreff(betreff);
ml.setTxt(text);
ml.setBearbeitung(new Timestamp(new Date().getTime()));
ml.setVersand(new Timestamp(new Date().getTime()));
ml.store();

MailEmpfaenger me = (MailEmpfaenger) Einstellungen.getDBService()
.createObject(MailEmpfaenger.class, null);
me.setMitglied(m);
me.setMail(ml);
me.setVersand(new Timestamp(new Date().getTime()));
me.store();

ma.setMail(ml);
ma.store();
}
catch (SendFailedException e1)
{
Expand Down

0 comments on commit 2cd0870

Please sign in to comment.