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#2914 Fix for incorrect sent count in message #21827

Merged
merged 1 commit into from
Oct 18, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

dev/core#2914 Fix for incorrect sent count in message

Before

count of sent emails doesn't reflect final send

After

Based on final send

Technical Details

@demeritcowboy does this cover it off
Comments

@civibot
Copy link

civibot bot commented Oct 14, 2021

(Standard links)

@civibot civibot bot added the 5.43 label Oct 14, 2021
@eileenmcnaughton eileenmcnaughton force-pushed the sent branch 2 times, most recently from 5c38cff to 6c36377 Compare October 14, 2021 06:23
@totten
Copy link
Member

totten commented Oct 15, 2021

r-test: The reported failure appears relevant. ⚠️

r-run: I tried two flows:

  1. ✔️ "Contacts => New Email" (ie the flow from dev/core#2914.) Final confirmation message seems to be fixed (now reports a real tally instead of 0).
  2. ✔️ "Find Contacts => ... => Email - send now". Worked before - and still works.

Tangentially, there is a bit of a UX quirk in how the tallies are reported before sending:

  1. ("Contacts => New Email") The page opens and mentions "Number of selected contacts: 0" (bottom). That is accurate when the page is first opened - but it becomes inaccurate when edit the recipient list (as you must do). May be better to hide it in this case (since we're probably too lazy to make the tally auto-update via jquery)? Screenshot from 2021-10-14 23-35-26
  2. ("Find Contacts => ...=> Email - send now") There are actually preselected contacts, and you usually don't need to add/remove recipients in this case... so it's plausible to show a tally. But this one doesn't. Of course, hiding the tally is OK - since the recipient list is still editable. Screenshot from 2021-10-14 23-36-10

@eileenmcnaughton
Copy link
Contributor Author

@totten " (as you must do)." - I guess I may not understand properly how this form is used as I assumed that would not be the most common way to use the form.

@demeritcowboy
Copy link
Contributor

Added a little note at https://lab.civicrm.org/dev/core/-/issues/2579#note_66389

@demeritcowboy
Copy link
Contributor

The reason the test fails is because buildQuickForm is when it determines the suppressed emails, and doesn't rebuild it again in some way during submit, so the only way at the moment to get the correct count is via $this->_toContactDetails. I think it should rebuild the list based on the submitted values not the originally passed in values. It needs to do it twice - the first time because it notifies on the form, and then again during submit so that it does the right thing, not just for counting but for avoiding sending to on-hold people that have been added etc.

@totten
Copy link
Member

totten commented Oct 15, 2021

" (as you must do)." - I guess I may not understand properly how this form is used as I assumed that would not be the most common way to use the form.

Yeah, there are several pageflows that load some variant of this form. One pageflow is to use the main menu to click "Contacts => New Email", which opens a blank email message. So there you need to type the recipient list. AFAIK, all the other pageflows come with some pre-selected recipients.

https://lab.civicrm.org/dev/core/-/issues/2579#note_66389

👍

@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy I pushed up a fix for the test - I have some doubt as to the validity of dead people being added to the 'to' before submission but this gets us back to them being filtered out again

@demeritcowboy
Copy link
Contributor

Thanks that seems to work.
Fair point about adding people using the form since aha it looks like the select doesn't present it as an option. (You could do it with the javascript console but nobody's going to do that.)

@demeritcowboy demeritcowboy merged commit d5ae6e4 into civicrm:5.43 Oct 18, 2021
@eileenmcnaughton eileenmcnaughton deleted the sent branch October 18, 2021 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants