sendemail is working

This commit is contained in:
pvincent
2021-08-27 22:03:50 +04:00
parent 6bcec1c572
commit a1ece5258a
6 changed files with 221 additions and 134 deletions
+1 -3
View File
@@ -444,7 +444,6 @@ class Cron extends Controller {
*/
function sendEmailsfromBuffer() {
App.log("Send Emails from Buffer");
print("<h3>Send Emails from Buffer</h3>");
// send
for (e in sugoi.db.BufferedMail.manager.search($sdate == null, {limit: 50, orderBy: -cdate}, false)) {
@@ -452,8 +451,7 @@ class Cron extends Controller {
if (e.isSent())
continue;
App.log('Send Email id=${e.id} - title=${e.title}');
print('#${e.id} - ${e.title}');
App.log('Send Email id=#${e.id} - title=${e.title}');
e.finallySend();
Sys.sleep(0.1);
}
+1 -10
View File
@@ -82,16 +82,7 @@ class Messages extends Controller {
var html = app.processTemplate("mail/message.mtt", {text: text, group: app.user.amap, list: getListName(listId)});
e.setHtmlBody(html);
// FIXME: re-apply sendMail
// App.sendMail(e, app.user.getAmap(), listId, app.user);
// Sys.command("sendemail", [
// "-f", "no-reply@comptoirduvrac.re", "-s", "mail1.zourit.net:587", "-t", "pvincent@comptoirduvrac.re", "-bcc",
// "pvincent974@gmail.com,pvincent974@laposte.net", "-u", subject, "-m", "alors tout va bien", "-xu", "postmaster@comptoirduvrac.re", "-xp",
// "QqQeAPT6EpoK"
// ]);
sys.io.File.saveContent('/tmp/my_file.json', "CONTENT");
App.sendMail(e, app.user.getAmap(), listId, app.user);
// store message
var lm = new db.Message();