Sendgrid将URL传递给href属性

我正在尝试通过sendgrid电子邮件发送重置密码链接。我的电子邮件模板是这样的

?

<html><head>
      <title>Reset Password</title>
      </style>
      <!--user entered Head Start--><link href="https://fonts.googleapis.com/css?family=Fira+Sans+Condensed&display=swap" rel="stylesheet"><style>
    body {font-family: 'Fira Sans Condensed', sans-serif;}
</style>
    </head>
    <body style="background-color:#9E9E9E;">
      <div style="padding:20px;border:1px solid #9E9E9E;background-color:white">
      <h1>Reset Password</h1>
      <hr>
      
      <p>Click the button below to reset your password.</p>
      <a href="" style="display:inline-block;padding:10px;background-color:#2196f3;color:white">RESET PASSWORD</a>
      <p>If you did not make this
      request, please ignore this email.</p>
      </div>
      <div>
      <p style="padding:20px;border:1px solid #9E9E9E;">Send by Information Systems.</p>
      <div>
    
  
</body></html>

?

后端代码是这样的

?

const msg = {
      to: 'someone@gmail.com',
      from: 'sender@example.org',
      templateId: 'xxxx',
      dynamic_template_data: {
        subject: 'Testing Templates',

      },
    };


    await sgMail.send(msg);

?

如何将URL地址传递给模板并将其附加到<a>标记中的href属性?

转载请注明出处:http://www.cdylmjg.com/article/20230401/1619899.html