Patch level : 12.0 1048

Files correlati     : 777.exe 777200a.msk 777200c.msk f20.trr f20.dir
Commento        :

Invio Certificazione unica per email
This commit is contained in:
Alessandro Bonazzi 2021-04-01 00:57:49 +02:00
parent 9b5002e9d9
commit e9519c1ead
2 changed files with 20 additions and 13 deletions

View File

@ -900,22 +900,28 @@ void split_IBAN(const char * iban, TString & iso, TString & cin,
}
}
static TString __test_mail("void");
void set_test_mail(const TString & email)
{
if (email.full())
__test_mail = email;
else
__test_mail = ini_get_string(CONFIG_STUDIO, "Mail", "TestMail");
}
bool send_mail(TToken_string & to, TToken_string & cc, TToken_string & ccn,
const char * subj, const char * text, TToken_string & attachment)
const char * subj, const char * text, TToken_string & attachment, bool ui, bool receipt)
{
TString subject(subj);
short flags = 0; // not UI
short flags = ui ? 1 : 0;
#ifdef DBG
TString test_mail = ini_get_string(CONFIG_STUDIO, "Mail", "TestMail");
if (test_mail.full())
{
to = test_mail;
cc.cut(0);
ccn.cut(0);
}
#endif
if (receipt)
flags |= 0x2;
if (__test_mail == "void")
set_test_mail(EMPTY_STRING);
if (__test_mail.full())
to = __test_mail;
if (subject.blank())
subject.cut(0) << TR("Invio di ") << attachment;
if (!(flags & 0x1) && to.empty_items() && cc.empty_items() && ccn.empty_items())

View File

@ -118,7 +118,8 @@ void build_IBAN(TString & iban, const char * iso, const char * icin,
void split_IBAN(const char * iban, TString & iso, TString & icin,
TString & bcin, TString & abi, TString & cab, TString & cc);
void set_test_mail(const TString & email);
bool send_mail(TToken_string & to, TToken_string & cc, TToken_string & ccn,
const char * subj, const char * text, TToken_string & attachment);
const char * subj, const char * text, TToken_string & attachment, bool ui, bool receipt);
#endif /* __UTILITY_H */