Update AWS parser for HTML emails
After updating the maintenance emails to go from AWS Health managed notifications they utilize an HTML format instead of plaintext. This was causing the parsing to fail. Adding support for the HTML emails from AWS health and maintaining previous code for plaintext (SNS) emails.
Thank you for the PR. Let's get the tests cleared up and do you have an example of this new format?
Hi @jvanderaa , I ran ruff over it so that CI check shouldn't fail any more. I have an example but would prefer not to send it on here. I can email or slack it over?
It would need to be obfuscated and added for the test. I can add it or you can add it. It would be better to come from you since you would know what would be sensitive and can change it. Such as circuit IDs from whatever format to something that uses all 1s and a's in the format.
here's the email without headers `
=20 =20 <style type=3D"text/css"> @media only screen and (min-width:480px) { .mj-column-per-100 { width:100% !important; max-width: 100%; } .mj-column-per-70 { width:70% !important; max-width: 70%; } .mj-column-per-30 { width:30% !important; max-width: 30%; } .mj-column-per-50 { width:50% !important; max-width: 50%; } } <style media=3D"screen and (min-width:480px)"> .moz-text-html .mj-column-per-100 { width:100% !important; max-width:= 100%; } .moz-text-html .mj-column-per-70 { width:70% !important; max-width: 70%; } .moz-text-html .mj-column-per-30 { width:30% !important; max-width: 30%; } .moz-text-html .mj-column-per-50 { width:50% !important; max-width: 50%; } =20 =20 <style type=3D"text/css"> =20 =20
@media only screen and (max-width:480px) {
table.mj-full-width-mobile { width: 100% !important; }
td.mj-full-width-mobile { width: auto !important; }
}
=20 <style type=3D"text/css"> =20 =20
=20 =20|
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
|
|
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
=20
|
I've added the email to the docstring and broken the parsers into plaintext and html
I think the expectations is to add the sample to the tests, here is a prior PR that updated the capabilities of an existing parser that should be a good guide: https://github.com/networktocode/circuit-maintenance-parser/pull/256/files
Alright, I've got the tests in place and refactored the html parser into its own parser.
Can I get an update on this? This is critical for us to have this functionality working soon as possible
Apologies @beetanz was out of pocket most of last week due to travel.
And the tests are not passing.
I think it should be passing the tests now?
Is there anything else that is needed here?
@scetron @pke11y or @glennmatthews can you put some eyes on this to validate the changes that I have made. I'm good.