Skip to content

Anchor Tag appending extra text from html template #1207

Open

Description

@rajashripise

I am creating the html template using the anchor tag to add link but text getting appended in anchor tag
this is my tag

  <a href="ResetUri" title="Reset" style="font-size: 20px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; color: #ffffff; text-decoration: none; padding: 15px 25px; border-radius: 2px; border: 1px solid #539be2; display: inline-block;">
      Reset Password
  </a>

ResetUri value is
https://domain-name.b2clogin.com/domain-name.com/B2C_1_DevTestPasswordReset/oauth2/v2.0/authorize?p=B2C_1_DevTestPasswordReset&client_id=1f933-4120-b2a1-a81ba10bc&redirect_uri=https://application-uri-development.azurewebsites.net&scope=openid&response_type=id_token&prompt=login

getting result text as :
Reset Password [domain-name.b2clogin.com]

getting result as follow
image

extra text getting updated

 var replacements = new Dictionary<string, string>
             {
                 {
                 "{LoginUri}", loginUrl
                 },
                 {
                 "ResetUri", resetPasswordUrl
                 },
                 {
                 "{UserPasssowrd}", userPasssowrd
                 },
                 {
                 "{Subject}", "Invitation"
                 }
             };

var plaintextcontent = string.Empty;
string filePath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Files", "UserInvitation.html");
string content = string.Empty;
using (StreamReader reader = new StreamReader(filePath))
{
    content = reader.ReadToEnd();
}
plaintextcontent = content;
foreach (var replacement in replacements)
{
    content = content.Replace(replacement.Key, replacement.Value);
}
var result = MailHelper.CreateSingleEmail(new SendGrid.Helpers.Mail.EmailAddress(fromAddress), new SendGrid.Helpers.Mail.EmailAddress(userName), "Invitation", "", content);
_ = await client.SendEmailAsync(result).ConfigureAwait(false);
```  This is my Code for email send

 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions