Commit 5c68849e authored by Johan Vervloet's avatar Johan Vervloet
Browse files

Closes #38 - The e-mail archive is now optional.

You can leave the address empty.
parent 03576609
......@@ -209,7 +209,6 @@ class CRM_Cdntaxreceipts_Form_Settings extends CRM_Core_Form {
$this->addRule('email_subject', 'Enter email subject', 'required');
$this->addRule('email_from', 'Enter email from address', 'required');
$this->addRule('email_archive', 'Enter email archive address', 'required');
$this->addRule('email_message', 'Enter email message', 'required');
}
else if ( $mode == 'defaults' ) {
......
......@@ -96,6 +96,9 @@ function cdntaxreceipts_processTaxReceipt( $receipt, &$collectedPdf = NULL, $pre
$mailparams['bcc'] = $email_archive;
}
else {
if ( empty($email_archive) ) {
$do_not_mail = 1;
}
$mailparams['toEmail'] = $email_archive;
}
......@@ -103,7 +106,7 @@ function cdntaxreceipts_processTaxReceipt( $receipt, &$collectedPdf = NULL, $pre
$ret = TRUE;
}
else {
$ret = CRM_Utils_Mail::send( $mailparams );
$ret = isset($do_not_mail) || CRM_Utils_Mail::send( $mailparams );
if ( $ret == TRUE ) {
// we have successfully processed. Log the receipt.
cdntaxreceipts_log($receipt);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment