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

CRM-20905: Make (simple_mail_limit) a configuration instead of h… #10705

Merged
merged 2 commits into from
Aug 21, 2017

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jul 20, 2017

Overview

When using the "Search Contacts" results to send individual emails to multiple recipients, the number of recipients is limited. This functionality prevents spamming and prevents overloading the mail-delivery system.

Before

If a user picks more than 50 contacts and tries to send, it displays an error.

After

Each user-organization may change the limit from 50 to something else by updating the hidden setting, simple_mail_limit. (Ex: To change it to 25, run cv api setting.create simple_mail_limit=25)**

@eileenmcnaughton
Copy link
Contributor Author

Note that most discussion of this PR is on #10693

@eileenmcnaughton
Copy link
Contributor Author

@omarabuhussein if you are happy with this based on the discussion on #10693 please confirm here that you think it is OK to merge

Copy link
Member

@omarabuhussein omarabuhussein left a comment

Choose a reason for hiding this comment

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

left a note ... also two things :

1- can you add this new setting to api/v3/examples/Setting/GetFields.php .

2- this is a new change and I would prefer seeing a clear description for it and explaining why the option is hidden,

if (count($this->_contactIds) > CRM_Contact_Form_Task_EmailCommon::MAX_EMAILS_KILL_SWITCH) {
CRM_Core_Error::statusBounce(ts('Please do not use this task to send a lot of emails (greater than %1). We recommend using CiviMail instead.', array(1 => CRM_Contact_Form_Task_EmailCommon::MAX_EMAILS_KILL_SWITCH)));
}
CRM_Contact_Form_Task_EmailCommon::bounceIfSimpleMailLimitExceeded(count($this->_contactIds));
Copy link
Member

Choose a reason for hiding this comment

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

I liked what Andrew suggested about using quick instead of simple

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm perhaps but it's called 'Send Email' here https://docs.civicrm.org/user/en/stable/email/what-you-need-to-know/ - it feels like scope creep to rebrand that feature & I'm a bit reluctant to entrench a user-term in the code if it's not accepted at the user level yet.

I could change all those code places to 'send_email' to match the docs - but not sure that is clearer than simple_mail

Copy link
Member

@xurizaemon xurizaemon Oct 28, 2017

Choose a reason for hiding this comment

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

just found this PR via SE question

+1 eileens' comment and also consider: if a site starts trying to send 1000 emails in a single request, this will not be "quick mail" at all (it'll probably start being "timeouty mail")

Agree that the branding is not consistent, terms that are descriptive of the difference ("direct email" vs "batched email"?) might be better, even if only for internal use (eg settings names).

…ardcoded value

Change-Id: Id03a77924121aec8fd83168d009202ca2aab06f7
Change-Id: I44a082a3eedf3548c7ff446df7d9b587de3b9016
@eileenmcnaughton
Copy link
Contributor Author

I have added the example update & updated the setting comment - per comment above I have reservations about starting to refer to it as quickEmail in the code if we haven't started using that in the user documentation

@omarabuhussein
Copy link
Member

omarabuhussein commented Jul 24, 2017

from coding perspective, this look fine for me to merge ..

though this should be documented here in the PR description and in the ticket description (as well as user docs maybe ?)

@eileenmcnaughton eileenmcnaughton changed the title CRM-20905: Make (max emails kill switch) a configuration instead of h… CRM-20905: Make (simple_mail_limit) a configuration instead of h… Jul 24, 2017
@totten
Copy link
Member

totten commented Jul 28, 2017

This is a good idea, and the implementation looks straight-forward, and it's been reviewed by Omar.

I agree the description needs work. This might be a good case to try reworking per https://github.com/civicrm/civicrm-core/blob/master/.github/PULL_REQUEST_TEMPLATE.md

Since this is new structure, it may be useful for us to publicly work through some examples. Here's a suggested reworking for this one.

(Note: I've flagged text as follows: removals use strike-through notation; new content uses bold; comments use {{...}})

Overview

Sending direct email to more than one user from tasks in contact search page is limited. When using the "Search Contacts" results to send individual emails to multiple recipients, the number of recipients is limited. {{When describing a context, start from the big-context and drill-down to the specific element. If you start from the specific element, many readers won't recognize it.}} This functionality prevents spamming and prevents overloading the mail-delivery system. {{Someone coming from a CHANGELOG or a debug-session may lack basic context.}}

Before

~~hardcoded to only 50 contact ~~ If a user picks more than 50 contacts and tries to send, it displays an error.

After

this could be diffrenet from organization to another so it would probably better to be a configuration Each organization may change the limit from 50 to something else by updating the hidden setting, simple_mail_limit. (Ex: To change it to 25, run cv api setting.create simple_mail_limit=25) {{Many users expect settings to be in the UI. That's not a mandate -- it's ok we have some hidden settings, but that should be communicated.}}

IMHO, it's ok to merge, but I'd like to pause a moment in case you or others have revisions to the description. Flagging merge ready so that you can merge without be accused of self-approving.

@totten totten added the merge ready PR will be merged after a few days if there are no objections label Jul 28, 2017
@eileenmcnaughton eileenmcnaughton merged commit 599472e into civicrm:master Aug 21, 2017
@eileenmcnaughton
Copy link
Contributor Author

24 days have passed (actually I thought this was merged) so merging

@eileenmcnaughton eileenmcnaughton deleted the kill_switch_setting branch August 21, 2017 23:37
@omarabuhussein
Copy link
Member

thanks @eileenmcnaughton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge ready PR will be merged after a few days if there are no objections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants