HTML templates – again

0

Hi all,
I'm trying to setup an user invitation HTML email template and I'm running into an error that states:

Member must satisfy regular expression pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*\{####\}[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]* 

Of course, my template does contain the {####} placeholder (see below). From what I can tell, this may be due to a missing regex flag. I say this as testing the above regex on the template below at regex101.com fails unless I enable the 'u' flag (full unicode match). I've tried setting this template from both the Cognito console and via the API. Anyone have any advice for dealing with this?

<!doctype html><title></title><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=viewport content="width=device-width,initial-scale=1"><meta http-equiv=X-UA-Compatible content="IE=edge"><style>a,body,table,td{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}table,td{mso-table-lspace:0;mso-table-rspace:0}img{-ms-interpolation-mode:bicubic}img{border:0;height:auto;line-height:100%;outline:0;text-decoration:none}table{border-collapse:collapse!important}body{height:100%!important;margin:0!important;padding:0!important;width:100%!important}a[x-apple-data-detectors]{color:inherit!important;text-decoration:none!important;font-size:inherit!important;font-family:inherit!important;font-weight:inherit!important;line-height:inherit!important}@media screen and (min-width:601px){.container{width:600px!important}}@media screen and (max-width:600px){.em_wrapper{width:100%!important}.em_hide{display:none!important}.em_left{text-align:left!important}.em_font1{font-size:34px!important;padding:20px 0!important}.em_heading{text-align:center!important}.em_padtop{padding-top:25px!important}}div[style*="margin: 14px 0;"]{margin:0!important}</style><body style=background-color:#fff;margin:0!important;padding:0!important><table align=center border=0 cellpadding=0 cellspacing=0 width=100%><tr><td align=center valign=top bgcolor=#ffffff><!--[if (gte mso 9)|(IE)]><table align=center border=0 cellspacing=0 cellpadding=0 width=600><tr><td align=center valign=top width=600><![endif]--><table align=center class=container border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:600px><tr><td align=left class="em_font1 em_heading" style="padding:40px 10px 50px 10px;font-family:Arial,sans-serif;font-size:36px;line-height:39px;color:#333;font-weight:600">Let's Get Your<br>Account Activated<tr><td align=left class="em_font1 em_heading" style="padding:10px 10px 60px 10px;font-family:Arial,sans-serif;font-size:24px;line-height:39px;color:#888b8d;font-weight:600">...in three easy steps.<tr><td align=right valign=top><!--[if (gte mso 9)|(IE)]><table align=left border=0 cellspacing=0 cellpadding=0 width=568><tr><td align=left valign=top width=568><![endif]--><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:568px><tr><td align=center valign=top style=padding-bottom:80px><table width=100% align=center cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=top style=font-size:0><!--[if (gte mso 9)|(IE)]><table align=center border=0 cellspacing=0 cellpadding=0 width=568><tr><td align=left valign=top width=303><![endif]--><div style=display:inline-block;max-width:303px;vertical-align:top;width:100%><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:303px><tr><td align=left valign=top><table width=303 align=left cellpadding=0 cellspacing=0 border=0 class=em_wrapper><tr><td width=21 class=em_hide> <td align=center valign=top><img src=https://app.villagemusicschool.com/img/loginIllustration.jpg width=210 height=210 alt="" border=0 style=display:block><td width=21 class=em_hide> </table></table></div><!--[if (gte mso 9)|(IE)]><td align=left valign=top width=265><![endif]--><div style=display:inline-block;max-width:265px;vertical-align:top;width:100%;text-align:left><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:265px><tr><td align=left valign=top><table width=265 align=center cellpadding=0 cellspacing=0 border=0 class=em_wrapper><tr><td width=21> <td align=center valign=top class=em_padtop><table width=100% align=center cellpadding=0 cellspacing=0 border=0><tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:24px;line-height:24px;color:#333;font-weight:700>Log In To<br>Your Account<tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d>Everything has a beginning (and for this it's getting logged in).<tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d>Use your email and temporary passphrase to log in to your Village Music School account.<tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d>Email<br><span style=font-weight:600>{username}</span><tr><td align=left style=font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d>Passphrase<br><span style=font-weight:600>{####}</span></table><td width=21> </table></table></div><!--[if (gte mso 9)|(IE)]><![endif]--></table></table><!--[if (gte mso 9)|(IE)]><![endif]--><tr><td align=right valign=top><!--[if (gte mso 9)|(IE)]><table align=left border=0 cellspacing=0 cellpadding=0 width=568><tr><td align=left valign=top width=568><![endif]--><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:568px><tr><td align=center valign=top style=padding-bottom:50px><table width=100% align=center cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=top style=font-size:0><!--[if (gte mso 9)|(IE)]><table align=center border=0 cellspacing=0 cellpadding=0 width=568><tr><td align=left valign=top width=303><![endif]--><div style=display:inline-block;max-width:303px;vertical-align:top;width:100%><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:303px><tr><td align=left valign=top><table width=303 align=left cellpadding=0 cellspacing=0 border=0 class=em_wrapper><tr><td width=21 class=em_hide> <td align=center valign=top><img src=https://app.villagemusicschool.com/img/pwUpdateIllustration.jpg width=210 height=210 alt="" border=0 style=display:block><td width=21 class=em_hide> </table></table></div><!--[if (gte mso 9)|(IE)]><td align=left valign=top width=265><![endif]--><div style=display:inline-block;max-width:265px;vertical-align:top;width:100%;text-align:left><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:265px><tr><td align=left valign=top><table width=265 align=center cellpadding=0 cellspacing=0 border=0 class=em_wrapper><tr><td width=21> <td align=center valign=top class=em_padtop><table width=100% align=center cellpadding=0 cellspacing=0 border=0><tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:24px;line-height:24px;color:#333;font-weight:700>Update Your<br>Passphrase<tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d>It's time to replace that temporary passphrase with a shiny, new one.<tr><td align=left style=font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d>There are a few requirements<tr><td align=left style=font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d><span style=font-weight:600>8+ characters</span><tr><td align=left style=font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d><span style=font-weight:600>1+ lowercase letters</span><tr><td align=left style=font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d><span style=font-weight:600>1+ uppercase letters</span><tr><td align=left style=font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d><span style=font-weight:600>1+ numbers</span><tr><td align=left style=font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d><span style=font-weight:600>1+ special characters</span></table><td width=21> </table></table></div><!--[if (gte mso 9)|(IE)]><![endif]--></table></table><!--[if (gte mso 9)|(IE)]><![endif]--><tr><td align=right valign=top><!--[if (gte mso 9)|(IE)]><table align=left border=0 cellspacing=0 cellpadding=0 width=568><tr><td align=left valign=top width=568><![endif]--><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:568px><tr><td align=center valign=top style=padding-bottom:80px><table width=100% align=center cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=top style=font-size:0><!--[if (gte mso 9)|(IE)]><table align=center border=0 cellspacing=0 cellpadding=0 width=568><tr><td align=left valign=top width=303><![endif]--><div style=display:inline-block;max-width:303px;vertical-align:top;width:100%><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:303px><tr><td align=left valign=top><table width=303 align=left cellpadding=0 cellspacing=0 border=0 class=em_wrapper><tr><td width=21 class=em_hide> <td align=center valign=top><img src=https://app.villagemusicschool.com/img/ccIllustration.jpg width=210 height=210 alt="" border=0 style=display:block><td width=21 class=em_hide> </table></table></div><!--[if (gte mso 9)|(IE)]><td align=left valign=top width=265><![endif]--><div style=display:inline-block;max-width:265px;vertical-align:top;width:100%;text-align:left><table align=left border=0 cellpadding=0 cellspacing=0 width=100% style=max-width:265px><tr><td align=left valign=top><table width=265 align=center cellpadding=0 cellspacing=0 border=0 class=em_wrapper><tr><td width=21> <td align=center valign=top class=em_padtop><table width=100% align=center cellpadding=0 cellspacing=0 border=0><tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:24px;line-height:24px;color:#333;font-weight:700>Add Your Card<tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d>We've got a new payment processor, so we'll need you to add a new card...or an old one.<tr><td align=left style=padding-bottom:20px;font-family:Arial,sans-serif;font-size:16px;line-height:21px;color:#888b8d>Whichever card you choose to add, we'll make sure it's securely stored for you.</table><td width=21> </table></table></div><!--[if (gte mso 9)|(IE)]><![endif]--></table></table><!--[if (gte mso 9)|(IE)]><![endif]--><tr><td align=left valign=top style=padding-bottom:80px><table align=center cellpadding=0 cellspacing=0 border=0 class=em_wrapper><tr><td align=center valign=top><table align=center cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=middle class=em_wht bgcolor=#4285f4 style="padding:16px 20px;font-size:16px;font-family:Arial,sans-serif;color:#fff;background-color:#699ef5;border-radius:4px"><a href=# target=_blank style=color:#fff!important;text-decoration:none!important;display:block>Activate My Account</a></table></table></table><!--[if (gte mso 9)|(IE)]><![endif]--></table>
asked 5 years ago241 views
2 Answers
0

I was able to resolve this issue by removing the rules within the <style/> tag and promoting them to inline styles. It's not 100% clear to me why this would resolve the issue, but I'm posting it here for posterity's sake.

Also, if you're attempting to update a template via the console, there are some UX issues that can make the state of your submission unclear. Error messages aren't necessarily cleared when you change the template and submit the form, navigating away and back to the form will not reset the template field but errors will be reset (implying that your template really was saved).

answered 5 years ago
0

Were you able to determine any more details on this? I have tried removing the style tags and the content for testing and I am still seeing the same error. I also verified the message on has the { and } characters in the one place for {####}

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions