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

[CCAP-642] - Sends confirmation email when provider agrees to care #1171

Merged
merged 4 commits into from
Feb 20, 2025

Conversation

analoo
Copy link
Contributor

@analoo analoo commented Feb 18, 2025

🔗 Jira ticket

CCAP-642

✍️ Description

  • Creates a new email class ILGCCEmail
  • Creates new SendGrid email signatures that allow the value to be passed
  • Adds tests
  • Sends Email to provider

📷 Design reference

✅ Completion tasks

  • Added relevant tests
  • Meets acceptance criteria

@analoo analoo marked this pull request as ready for review February 18, 2025 21:57
@analoo analoo requested a review from enyia21 February 18, 2025 21:57
@github-actions github-actions bot requested a review from cram-cfa February 18, 2025 21:57
@enyia21 enyia21 temporarily deployed to il-gcc-ccap-643-provide-amuuk0 February 18, 2025 21:58 Inactive
@analoo analoo requested review from spokenbird and removed request for cram-cfa February 18, 2025 21:59
@analoo analoo force-pushed the CCAP-643-provider-confirmation-email branch from cce87d9 to 68e897a Compare February 18, 2025 22:05
@enyia21 enyia21 temporarily deployed to il-gcc-ccap-643-provide-amuuk0 February 18, 2025 22:05 Inactive
@analoo analoo changed the title [CCAP-643] - Sends confirmation email when provider agrees to care [CCAP-642] - Sends confirmation email when provider agrees to care Feb 18, 2025
Copy link
Contributor

@enyia21 enyia21 left a comment

Choose a reason for hiding this comment

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

Small nits but good to go

@@ -21,7 +21,7 @@ public class SendGridEmailService {
private final SendGrid sendGrid = new SendGrid(System.getenv("SENDGRID_API_KEY"));

public Response sendEmail(String recipientAddress, String senderName, String subject, Content content) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just delete the top sendEmail method in favor of the one that accepts ILGCCEmail instead of overloading?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - we just need to move the other actions to the new sendEmail class. I didn't make the change here because the ticket was already getting pretty big and I wanted to get a thumbs up on the new approach first.

Copy link
Contributor

@cram-cfa cram-cfa left a comment

Choose a reason for hiding this comment

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

When you're all done with the other comments/changes, can you also make sure you run the IntelliJ formatter and make sure everything has the correct spacing, etc? Thanks!

@enyia21 enyia21 temporarily deployed to il-gcc-ccap-643-provide-amuuk0 February 19, 2025 21:22 Inactive
@analoo analoo force-pushed the CCAP-643-provider-confirmation-email branch from 4065942 to 4bee67f Compare February 19, 2025 21:23
@enyia21 enyia21 temporarily deployed to il-gcc-ccap-643-provide-amuuk0 February 19, 2025 21:24 Inactive
} else {
// More than 2 childrenInitials, use comma for all but the last one
String last = childrenInitials.remove(childrenInitials.size() - 1); // Remove and keep the last name
return String.join(", ", childrenInitials) + " and " + last; // Join remaining with commas, append 'and last'
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this method work for Spanish (or other future languages)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. This does not support Spanish currently and neither does the original implementation. I'll fix it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess for spanish, since the actual way this would be written doesn't vary, you could just pull a single string of "and" vs "y" ... right?

(this would all fall apart if we were doing like... Arabic?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - you are correct for Spanish. It would probably break in other languages.

Copy link
Contributor

Choose a reason for hiding this comment

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

cool, let's just worry about Spanish and when we run into another language where this doesn't work -- and that's probably a non-western/non-latin based language -- we can worry about it. And by "we" I mean "someone else in the future who is probably not us" 😎


String emailCopy = action.setBodyCopy(emailData, Locale.ENGLISH);

assertThat(emailCopy).contains(
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems weird to me that we have tests that are now dependent on hardcoded strings; I thought we decided to stop hardcoding text and instead wanted to load things from the messages.properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fair. I can update the tests to use the message keys instead of the hard coded strings.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big deal, just wanted to consistent.

@enyia21 enyia21 temporarily deployed to il-gcc-ccap-643-provide-amuuk0 February 19, 2025 23:30 Inactive
@enyia21 enyia21 temporarily deployed to il-gcc-ccap-643-provide-amuuk0 February 19, 2025 23:41 Inactive
@analoo analoo dismissed spokenbird’s stale review February 20, 2025 02:14

addressed feedback

@analoo analoo merged commit c836223 into main Feb 20, 2025
5 checks passed
@analoo analoo deleted the CCAP-643-provider-confirmation-email branch February 20, 2025 02:26
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