Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor Tag appending extra text from html template #1207

Open
rajashripise opened this issue Jul 15, 2024 · 0 comments
Open

Anchor Tag appending extra text from html template #1207

rajashripise opened this issue Jul 15, 2024 · 0 comments

Comments

@rajashripise
Copy link

rajashripise commented Jul 15, 2024

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

 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant