} else { } } $new = false; if ($contrib->id == '') { $new = true; } if (count($error_detected) == 0) { $store = $contrib->store(); if ($store === true) { //contribution has been stored :) if ($new) { //if an external script has been configured, we call it if ($preferences->pref_new_contrib_script) { $es = new Galette\IO\ExternalScript($preferences); $res = $contrib->executePostScript($es); if ($res !== true) { //send admin a mail with all details if ($preferences->pref_mail_method > GaletteMail::METHOD_DISABLED) { $mail = new GaletteMail(); $mail->setSubject(_T("Post contribution script failed")); /** TODO: only super-admin is contacted here. We should send * a message to all admins, or propose them a chekbox if * they don't want to get bored */ $mail->setRecipients(array($preferences->pref_email_newadh => str_replace('%asso', $preferences->pref_name, _T("%asso Galette's admin")))); $message = _T("The configured post contribution script has failed."); $message .= "\n" . _T("You can find contribution information and script output below."); $message .= "\n\n"; $message .= $res; $mail->setMessage($message);