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

[REF] Code simplification & unit test on suppressed emails in task #17393

Merged
merged 1 commit into from
May 26, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 26, 2020

Overview

Minor code simplification, add test

Before

Long winded code -
in Build form

  1. set $this->_contactDetails to what is effectively the result of a contact.get on the ids
    filtered by $this->_allContactIds
  2. iterate through $this->_allContactIds & look for values in the array returned by searching for those ids
  3. if they are suppressed then increment a counter and unset them from the original array
  4. if they DO exist then add them to another array (initially empty) $this->_contactDetails

in submit
De-wrangle the contacts by array-diffing the 2 arrays above to get the suppressed ones & then wrangling them for a message

After

Set the suppressed emails in the first place as their own array, using the final required style

Technical Details

Comments

@civibot
Copy link

civibot bot commented May 26, 2020

(Standard links)

@civibot civibot bot added the master label May 26, 2020
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.

2 participants