45 if (!mail($this->
mailto, $this->subject, $this->
content,$this->header))
47 throw new Exception(
'send failed');
78 if ($max_email == 0 )
return false;
81 if ($max_email == -1 )
return true;
86 if ( $email_sent >= $max_email)
return false;
97 $max_email = $p_repo->
get_value(
"select dos_email from ac_dossier where dos_id=$1",
98 array($p_dossier_id));
99 if ($max_email ==
"")
return 0;
111 $email_sent = $p_repo->
get_value (
'select de_sent_email from dossier_sent_email where dos_id = $1 and de_date=$2',
113 if ($email_sent ==
"")
return 0;
128 }
catch (\Exception
$e) {
131 if ( defined(
'ALLOWED_EMAIL_DOMAIN') )
133 if ( ALLOWED_EMAIL_DOMAIN !=
"")
135 $as_domain=explode(
",", ALLOWED_EMAIL_DOMAIN);
137 foreach ($as_domain as $domain) {
139 if (strpos($this->
from,$domain) != 0 ) {
145 throw new Exception(
"Domaine email {$this->from} interdit",
EXC_INVALID);
163 if ( $p_dossier == -1)
return ;
165 if ( $email_sent == 0 ){
166 $p_repo->
exec_sql(
"insert into public.dossier_sent_email(de_sent_email,dos_id,de_date) values($1,$2,$3)",
171 $p_repo->
exec_sql(
"update dossier_sent_email set de_sent_email=de_sent_email+1 where dos_id=$1 and de_date=$2",
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
else $card content[$j]['j_montant']
get_value($p_sql, $p_array=null)
return the value of the sql, the sql will return only one value with the value
exec_sql($p_string, $p_array=null)
send a sql string to the database
contains the class for connecting to Noalyss
mailto($p_mailto)
set the recipient
Send email for Noalyss after checking if it is possible : if cannot be sent if the limit of max email...
get_email_sent(Database $p_repo, $p_dossier_id, $p_date)
Return the amount of send emails for the date (YYYYMMDD)
verify()
check if there is a mandatory domain, if yes
increment_mail(Database $p_repo, $p_dossier, $p_date)
Add $p_amount_email to email sent.
can_send()
Check if email can be sent from a folder.
get_max_email(Database $p_repo, $p_dossier_id)
return max email the folder can send
const EMAIL_LIMIT
Exception.