Closed juliexmartin closed 2 months ago
This is proving to be trickier than I expected especially after reading the spike documentation. I've tried a few different ways of creating the action link, but haven't had any success so far. I will try working with Michael in the morning to see if we can put our heads together on this.
I worked with Michael briefly this morning, but Mistune continues to be a nightmare. The custom lexer I added appears to be working when the notify_email_markdown
object is called directly, but doesn't work when called from somewhere else, like get_html_email_body
. There seems to be something I'm missing here, so I'm still trying to understand what that is.
I added a unit test that passes when calling notify_email_markdown
. I thought that would be sufficient, but it seems I'll need to add some tests to ensure everything is working together as expected.
Met with Kyle and there weren't any obvious solutions jumping out at us. Kyle is going to take a look on his own sometime today, and I'll continue to work on it as well. Maybe the Mistunes code has some hints?
After looking into it a bit more Kyle managed to help me get un-stuck from the problem I was facing. Now I need to do some testing and confirm the expectation with someone from the Strike team.
With how we implemented the lexer I'm currently hitting a problem with it not properly recognizing newlines within text. This is causing test_paragraphs
to fail when using the notify_email_markdown
function, which uses the updated code. There's another way I can have it work, but it's more "hacky" than I'd like.
So it looks like ignoring mistune was the way to go. It might need some styling changes, but I was able to add a template with action links! The image showed in the previews of the email template and they in the email when I sent one to myself.
Coordinated with Ian and Elissa to make sure the action link is looking how it's supposed to. There's a little more work to do based on their feedback, but I'm hoping to have the PR up Friday.
Met with Ian this morning to talk about the expectations for the action link design. I'll have to wait for Elisa to get back to ask her what she meant with the AC that talks about the action link being in "card format."
The new changes and thorough unit testing took a little longer than I expected, so the PR is not up yet. Everything seems to be working locally and most scenarios are covered by the unit tests. I'll deploy and test Monday morning. As long as everything looks good during that testing the PR will be open for review.
Found a bug when testing this morning, so I had to clear that up, which deplayed opening the PR. This is carrying over to the new sprint to make sure we have time to QA it before closing it out.
The ticket took a long time in general because it had to be reworked a couple of times to find a solution that would work consistently and not break any existing functionality. The older version of Mistune that we use also does not have very robust documentation, so a lot of work went into going through that packages code to figure out how things work.
QA PASSED
PRs (utils and api) approved and merged; deployed to Perf in Pipieline. Promoted the template that Evan created in Dev to Perf.
Template preview route in Perf:
POST 201 response showing the content with the body:
Received email:
YouTube review indicates that the link works. Sadly, I had to click the link to test it. And now I have been rickrolled.
User Story - Business Need
Clients have asked for a way to emphasize call to action links in email content, like a button. VA design standards does not support a button, but UX has found a promising design element called an action link which they'd like to add to the portal template formatting options.
User Story(ies)
As a VA Notify-onboarded business line, I want to call attention to the primary link in the email So that the Veteran is more likely to click on the link.
Additional Info and Resources
Image files for action links are here. These would go in the same va.gov platform s3 bucket as the VA logo.
Email formatting is controlled by jinja in the utils repo:
https://github.com/department-of-veterans-affairs/notification-utils/blob/master/notifications_utils/field.py#L58
The formatting element for this is:
>>[webpage](url)
Portal formatting key:
Notify Email Markdown Formatting Guide
Action link is
https://<env>-va-gov-assets.s3-us-gov-west-1.amazonaws.com/img/vanotify-action-link.png
Engineering Checklist
However we are using mistune is awful and it was ignored for this ticket after spending way to long trying to get it to work properly.
Acceptance Criteria