使用bash

时间:2018-07-10 17:29:10

标签: html bash

我正在编写一个bash脚本,如果用户的AWS密钥已过期,它将向用户发送电子邮件。我想包含一个指向Service Now票证的可单击链接,他们可以使用这些链接来旋转其AWS密钥。

这是脚本的一部分,用于设置电子邮件的文本:

fusion_link='<a href="https://company.service-now.com/myfusion?id=sc_cat_item&sys_id=7949c77e6ffc310048c83cb44b3ee4a7">Change AWS Configuration</a>'
   template1="Hello $first_name, \n\nYour access key: $user_access_key1 for user name: $user_name was created on $date1 and needs to be replaced.\n\nThis key is in AWS Account: $aws_key ($accountnumber).\n\nPlease open up a fusion ticket using this catalog item: $fusion_link to have Cloud Ops rotate your keys.\n\nAll AWS Keys need to be replaced if they are older than 90 days.\n\nRegards,\nCloud Ops"

但是当电子邮件到达Outlook(打开HTML)时,这就是我得到的输出。链接未形成,因此用户可以单击它:

Hello Tim, 

Your access key: AKIAI7EYXZMWBBAOLYJA for user name: tdunphy was created on Thu Jan  4 16:03:32 EST 2018 and needs to be replaced.

This key is in AWS Account: company-ab-nonprod (151528745488).

Please open up a fusion ticket using this catalog item: <a href="https://company.service-now.com/myfusion?id=sc_cat_item&sys_id=7949c77e6ffc310048c83cb44b3ee4a7">Change AWS Configuration</a> to have Cloud Ops rotate your keys.

All AWS Keys need to be replaced if they are older than 90 days.

Regards,
Cloud Ops

我正在使用以下行在bash脚本中发送电子邮件:

echo -e  "$template1" | /usr/bin/mail -s "AWS Key Rotation Needed for $user_name in $aws_key" "$email_address"

电子邮件中有锚标记,但不可单击。如何正确设置链接的格式,以便用户单击它?

0 个答案:

没有答案