Skip to content

Commit

Permalink
adding cc on register email to inform cesmii devops of register. Fixg…
Browse files Browse the repository at this point in the history
…in a few cosmetics.
  • Loading branch information
scoxen1 committed Aug 22, 2023
1 parent 56f57cc commit ccd6ccc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,29 @@ public async Task<IActionResult> OnPostAsync(string returnUrl = null)
values: new { area = "Identity", userId = user.Id, code = code, returnUrl = returnUrl },
protocol: Request.Scheme);

//notify registering user
StringBuilder sbBody = new StringBuilder();
sbBody.AppendLine("<h1>Welcome to the CESMII UA Cloud Library</h1>");
sbBody.AppendLine("<p>Thank you for creating an account on the CESMII UA Cloud Library. ");
sbBody.AppendLine($"<b>Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.</b></p>");
if (_userManager.Options.SignIn.RequireConfirmedAccount)
{
sbBody.AppendLine($"<b>Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.</b></p>");
}
sbBody.AppendLine("<p>The CESMII UA Cloud Library is hosted by <a href='https://www.cesmii.org/'>CESMII</a>, the Clean Energy Smart Manufacturing Institute! This Cloud Library contains curated node sets created by CESMII or its members, as well as node sets from the <a href='https://uacloudlibrary.opcfoundation.org/'>OPC Foundation Cloud Library</a>.</p>");
sbBody.AppendLine("<p>Sincerely,<br />CESMII DevOps Team</p>");

await _emailSender.SendEmailAsync(Input.Email, "CESMII | Cloud Library | New Account Confirmation",
sbBody.ToString());

//notify CESMII dev ops as well
StringBuilder sbBody2 = new StringBuilder();
sbBody2.AppendLine("<h1>CESMII UA Cloud Library - New Account Sign Up</h1>");
sbBody2.AppendLine($"<p>User <b>'{Input.Email}'</b> created an account on the CESMII UA Cloud Library. ");
sbBody2.AppendLine("<p>The CESMII UA Cloud Library is hosted by <a href='https://www.cesmii.org/'>CESMII</a>, the Clean Energy Smart Manufacturing Institute! This Cloud Library contains curated node sets created by CESMII or its members, as well as node sets from the <a href='https://uacloudlibrary.opcfoundation.org/'>OPC Foundation Cloud Library</a>.</p>");
sbBody2.AppendLine("<p>Sincerely,<br />CESMII DevOps Team</p>");
//await _emailSender.SendEmailAsync("[email protected]", "CESMII | Cloud Library | New Account Sign Up",sbBody2.ToString());
await _emailSender.SendEmailAsync("[email protected]", "CESMII | Cloud Library | New Account Sign Up",sbBody2.ToString());

if (_userManager.Options.SignIn.RequireConfirmedAccount)
{
return RedirectToPage("RegisterConfirmation", new { email = Input.Email, returnUrl = returnUrl });
Expand Down
4 changes: 2 additions & 2 deletions UACloudLibraryServer/Components/Pages/Explorer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@using Opc.Ua.Cloud.Library.Models

<div style="height:100%">
<div class="uacl-container">
<div class="uacl-container pb-3 mb-4">
<div class="uacl-content">
<div class="container">
@if (Loading)
Expand Down Expand Up @@ -74,7 +74,7 @@
}
</div>
</div>
<div class="uacl-pagination pt-2">
<div class="uacl-pagination pt-2 mb-3">
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center">
<li class="page-item"><a class="page-link" @onclick="() => changePage(-1)">Previous</a></li>
Expand Down
2 changes: 1 addition & 1 deletion UACloudLibraryServer/SendGridEmailSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Task SendEmailAsync(string email, string subject, string htmlMessage)
if (string.IsNullOrEmpty(emailReplyTo)) emailReplyTo = "[email protected]";

SendGridMessage msg = new SendGridMessage() {
From = new EmailAddress(emailFrom),
From = new EmailAddress(emailFrom,"CESMII Dev Ops"),
ReplyTo = new EmailAddress(emailReplyTo),
Subject = subject,
PlainTextContent = htmlMessage,
Expand Down
2 changes: 1 addition & 1 deletion UACloudLibraryServer/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<div class="body-content px-4 py-2 pb-0">
<div class="card-text mb-0">
<p>
If you want to <b>access the UA Cloud Library from your own software</b>, source code for a client implementation can also be found on Github. Check it out here!
If you want to access the UA Cloud Library from your own software, source code for a client implementation can also be found on Github. Check it out here!
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion UACloudLibraryServer/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="d-flex align-items-center" >
<a class="navbar-brand headline-2 text-nowrap" asp-area="" asp-controller="Home" asp-action="Index">
<img class="logo mr-3 mb-2" src="~/logo-cesmii.svg" alt="CESMII Logo"/>
CESMII UA Cloud Library
UA Cloud Library
</a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
Expand Down

0 comments on commit ccd6ccc

Please sign in to comment.