schedulator: only do weekdays, not weekends.
[wvapps.git] / wvprint / email.cc
blob3e0e275ad5af7eb18faa2874f1656fd2665e3544
1 /*
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2003 Net Integration Technologies, Inc.
5 * This is the email feedback stuff
6 */
9 #include <wvpipe.h>
10 #include "email.h"
12 #define SENDMAIL "/usr/sbin/sendmail"
13 //#define SENDMAIL "/home/pp/bin/fake-sendmail"
14 #define CONTRIBUTION_EMAIL "pphaneuf@nit.ca"
16 void contribute(UniConf& cfg)
18 const char *args[] = {SENDMAIL, "-oi", CONTRIBUTION_EMAIL, 0};
19 WvPipe mail(args[0], args, true, false, false);
20 UniConf::Iter i(cfg);
22 if (mail.child_exited())
23 exit(1);
25 mail.print("To: "CONTRIBUTION_EMAIL"\n");
26 mail.print("Subject: contribution to WvPrint database\n");
27 mail.print("\nWvPrint configuration file:\n");
29 i.rewind();
30 while (i.next())
32 const UniConf &u = *i;
33 mail.print("\n[%s]\n", u.key());
34 i().dump(mail);
35 cfg[u.key()]["contributed"].set("1");
38 mail.close();
40 mail.finish();