Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#86 Notify admin when testing email if CIVICRM_MAIL_LOG_AND_SEND is set #12037

Merged
merged 2 commits into from
Apr 29, 2018

Conversation

mattwire
Copy link
Contributor

Overview

When CIVICRM_MAIL_LOG_AND_SEND is set the admin is not notified if it is set, but they are if CIVICRM_MAIL_LOG is set. With this PR they are notified if either is set.

https://lab.civicrm.org/dev/core/issues/86

Before

No notification if CIVICRM_MAIL_LOG_AND_SEND is set.

After

localhost_8000_civicrm_admin_setting_smtp__qf_smtp_display true qfkey 0bb739f2972c8a93320e2ab3b5b2e28f_2576 1

@eileenmcnaughton
Copy link
Contributor

fail is unrelated

@@ -170,7 +169,10 @@ public function postProcess() {
$errorScope = CRM_Core_TemporaryErrorScope::ignoreException();
$result = $mailer->send($toEmail, $headers, $message);
unset($errorScope);
if (defined('CIVICRM_MAIL_LOG')) {
if (defined('CIVICRM_MAIL_LOG_AND_SEND')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be defined('CIVICRM_MAIL_LOG_AND_SEND') && defined('CIVICRM_MAIL_LOG') since per below
CIVICRM_MAIL_LOG_AND_SEND doesn't work in isolation - also defined is not enough of a test as they could be defined as 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton Ok, yes. Updated the PR to reflect this. We don't check the value of other defines, only check if they are defined or not - I've changed the "value" to 1 in the settings template for consistency/clarity.

@eileenmcnaughton
Copy link
Contributor

OK - I'd prefer we did check the value but given the triviality of this fix I'm prepared to let it go

@monishdeb
Copy link
Member

Merging as per tag

@monishdeb monishdeb merged commit 6bba6d7 into civicrm:master Apr 29, 2018
@davialexandre
Copy link
Member

@mattwire
Copy link
Contributor Author

@davialexandre see https://lab.civicrm.org/dev/core/issues/86 there are actually 3 PRs for this

@davialexandre
Copy link
Member

@mattwire since there’s no link anywhere to this third PR, it’s a bit hard to find it.
I think this PR should have been merged only after the civicrm-package one is merged.
Also, I think this is not a simple typo fix. This constant has been there for a while and people might been using it (I use it). So, I think that if we really want to fix the typo we should first deprecate the mistyped one, add a new constant, suport both for a while and then finally remove the deprecated one

@mattwire
Copy link
Contributor Author

@davialexandre Sorry, the gitlab issue was meant to reference it but I put the wrong link in for the civicrm-packages PR - now fixed. Do constants with spaces actually work? It wasn't documented nor in the default settings file and it's generally meant for debug/development so I would think it's ok to just mention it in the release notes rather than have an overlap. If it's a problem, you can always define both in your config files.

@eileenmcnaughton
Copy link
Contributor

@davialexandre @mattwire I think we should document CIVICRM_MAIL_LOG_AND_SEND but we should make both work

@davialexandre
Copy link
Member

@mattwire it works partially (even though the documentation here indicates it should not work at all). Check this example: https://3v4l.org/BvFLb

@eileenmcnaughton
Copy link
Contributor

@davialexandre - did you see I merged the packages PR so we can start to kiss it goodbye

@mattwire mattwire deleted the mail_constants branch September 25, 2018 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants