Skip to content

Conversation

@joshglazer
Copy link
Member

Description

Allow for filtering by entity.type or entityContact.relationshipTitle when sending emails. This is an enhancement of PR #295. In that PR, the corresponding front-end code was filtering emails by entity.type, but was actually sending relationshipTitle instead. I adjusted this endpoint so either option will work.

Related PRs

#295

Todos

N/A

Deploy Notes

N/A

Steps to Test or Reproduce

Click the email entities button from the dashboard of Healthcare Rollcall and choose an entity type.

Impacted Areas in Application

List general components of the application that this PR will affect:
Email Entities by entity type

@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #319 (a4514c0) into master (6f36506) will decrease coverage by 0.37%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #319      +/-   ##
==========================================
- Coverage   84.59%   84.21%   -0.38%     
==========================================
  Files          17       17              
  Lines         675      678       +3     
==========================================
  Hits          571      571              
- Misses        104      107       +3     
Impacted Files Coverage Δ
src/routes/contact.js 76.72% <80.00%> (-0.84%) ⬇️
src/models/entity.js 85.71% <0.00%> (-7.15%) ⬇️
src/models/contact.js 82.35% <0.00%> (-5.89%) ⬇️
src/email/index.js 86.66% <0.00%> (+6.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f36506...a4514c0. Read the comment docs.

@joshglazer joshglazer mentioned this pull request Nov 25, 2020
2 tasks
OrbelinP
OrbelinP previously approved these changes Nov 25, 2020
@blakenan-bellese
Copy link
Contributor

blakenan-bellese commented Nov 30, 2020

@joshglazer I'm testing this I want to make sure we are aligned... Two questions:

  1. Did this PR add support for entity type on the /contact/send endpoint OR the /contact/send/{type}/{id} OR does this PR affect both endpoint?
  2. How is entity type passed on the API call? Is it in the payload like the sample in the Swagger Doc for relationshipTitle (below)? if so, what is the syntax?

{ "relationshipTitle": [ "Primary Contact" ] }

I'm asking because I can send a bunch of emails using /contact/send with no payload, but all payloads I add result in a 400 - No contacts to email

@joshglazer
Copy link
Member Author

Hey @blakenan-bellese thanks for taking a look. I only changed the /contact/send endpoint. I found that the /contact/send/{type}/{id} endpoint did not work as expected, it was built to send one email to entity.email instead of sending multiple emails to the contacts associated with the entity. I was able to build the additional filters into the /contact/send endpoint, and I'd suggest removing the other endpoint, but I was hesitant to remove code that I didn't write. If you're ok with that, I'd be happy to remove the unneeded endpoint.

I apologize for not updating the swagger documentation. I've made some updates with the additional filters that can be passed into the /contact/send endpoint and pushed that up to this PR this morning.

@blakenan-bellese blakenan-bellese merged commit b6c9c97 into CodeForBaltimore:master Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants