From 4488b6c2eb1a3ddf20e190ebd28953e4f3f01042 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Mon, 21 Sep 2026 09:56:01 +0200 Subject: payroll: lönebesked PDF and mail (schema v11) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mail.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/mail.h (limited to 'src/mail.h') diff --git a/src/mail.h b/src/mail.h new file mode 100644 index 0000000..5efade5 --- /dev/null +++ b/src/mail.h @@ -0,0 +1,26 @@ +#ifndef BOKF_MAIL_H +#define BOKF_MAIL_H + +#include +#include +#include + +struct mail_message { + const char *to; + const char *subject; + const char *body; + const char *attach_name; + const unsigned char *attach; + size_t attach_len; +}; + +/* Checks the org's SMTP settings (including decrypting the stored + smtp_password) without sending. 0 configured, -1 not configured. */ +int mail_config_check(sqlite3 *db, int64_t org_id, char *err, size_t errlen); + +/* Sends m as a PDF attachment. 0 sent, -1 not configured, -2 send failed. + err receives an English message; secrets are never included. */ +int mail_send_pdf(sqlite3 *db, int64_t org_id, const struct mail_message *m, + char *err, size_t errlen); + +#endif -- cgit v1.3