当用户通过我的应用程序注册时,Cognito会发送一封带有验证链接的邮箱.
AWS Cognito提供了一个模板({## text ##}
),可以转换为某种形式的链接,例如<a href='link-to-confirm'> text </a>
.
如何将CSS样式添加到这个a
标签?
当用户通过我的应用程序注册时,Cognito会发送一封带有验证链接的邮箱.
AWS Cognito提供了一个模板({## text ##}
),可以转换为某种形式的链接,例如<a href='link-to-confirm'> text </a>
.
如何将CSS样式添加到这个a
标签?
您可以在<head>
节中使用<style>
标记.例如
<head>
<style>
a {color : orange !important;}
a:hover {color : red !important;}
</style>
</head>
<body>
<a href="www.google.com">Test link</a>
{##Cognito link##}
</body>
我自己也试过了,至少在Gmail上是有效的.当我悬停在上面时,它也会变成红色,只是我无法截屏.
最后一条声明,据我所知,邮箱样式最好是内联的(比如<a style="...">...</a>
).因此,根据邮箱客户端的不同,这种方法可能不受支持.不过,至少我已经在Gmail上测试过了.
如果您真的需要使用内联CSS,您仍然可以通过使用Cognito触发器调用Lambda函数完全定制邮箱来实现.以article为例.我没有跳到这个解决方案,因为这主要是为了当你需要动态邮箱内容.