wip on mail
This commit is contained in:
parent
529909c3d1
commit
d0d0e0390b
@ -109,7 +109,24 @@ $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
|
|||||||
if ($subjecttosend && $texttosend) {
|
if ($subjecttosend && $texttosend) {
|
||||||
$moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n";
|
$moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n";
|
||||||
|
|
||||||
$result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
global $conf, $langs;
|
||||||
|
|
||||||
|
// Envoi mail confirmation
|
||||||
|
$from = $conf->email_from;
|
||||||
|
if (!empty($conf->global->ADHERENT_MAIL_FROM)) {
|
||||||
|
$from = $conf->global->ADHERENT_MAIL_FROM;
|
||||||
|
}
|
||||||
|
|
||||||
|
$trackid = 'mem'.$this->id;
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
|
$mailfile = new CMailFile($subjecttosend, $thirdparty->email, $from, $texttosend, array(), array(), array(), "", "", 0, -1, '', '', $trackid, $moreinheader);
|
||||||
|
if ($mailfile->sendfile()) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->error = $langs->trans("ErrorFailedToSendMail", $from, $this->email).'. '.$mailfile->error;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -177,13 +177,11 @@ if ($subscription == 'subscriptionok' && $ref == $reffrompayment) {
|
|||||||
$paiement->datepaye = dol_now();
|
$paiement->datepaye = dol_now();
|
||||||
$paiement->amount = $paidinvoice->total_ttc;
|
$paiement->amount = $paidinvoice->total_ttc;
|
||||||
$paiement->amounts[] = $paidinvoice->total_ttc;
|
$paiement->amounts[] = $paidinvoice->total_ttc;
|
||||||
|
|
||||||
$paiement_id = $paiement->create($user, 1, $thirdparty); // This include closing invoices and regenerating documents
|
$paiement_id = $paiement->create($user, 1, $thirdparty); // This include closing invoices and regenerating documents
|
||||||
if ($paiement_id < 0) {
|
if ($paiement_id < 0) {
|
||||||
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Validating the attendee
|
// Validating the attendee
|
||||||
$attendeetovalidate = new ConferenceOrBoothAttendee($db);
|
$attendeetovalidate = new ConferenceOrBoothAttendee($db);
|
||||||
$resultattendee = $attendeetovalidate->fetch($ref);
|
$resultattendee = $attendeetovalidate->fetch($ref);
|
||||||
@ -191,7 +189,6 @@ if ($subscription == 'subscriptionok' && $ref == $reffrompayment) {
|
|||||||
setEventMessages(null, $attendeetovalidate->errors, "errors");
|
setEventMessages(null, $attendeetovalidate->errors, "errors");
|
||||||
} else {
|
} else {
|
||||||
$attendeetovalidate->setStatut(1);
|
$attendeetovalidate->setStatut(1);
|
||||||
// @todo send email
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user