Skip to content

Commit

Permalink
Merge pull request #44 from dynamicweb/dbe/20958-email-template-on-us…
Browse files Browse the repository at this point in the history
…er-provider

email template on user provider
  • Loading branch information
dw-sha authored Sep 3, 2024
2 parents 156a073 + 81ac17f commit 6785808
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.7.0</Version>
<Version>10.7.1</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>User Provider</Title>
<Description>User Provider</Description>
Expand Down
8 changes: 7 additions & 1 deletion src/UserDestinationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,13 @@ public void SendUserPasswords()
{
if (!string.IsNullOrEmpty(_emailTemplate))
{
Dynamicweb.Rendering.Template tmpl = new Dynamicweb.Rendering.Template(_emailTemplate);
var path = $"/UserManagement/UserProvider/{_emailTemplate}";
if (!System.IO.File.Exists(SystemInformation.MapPath($"/Files/Templates{path}")))
{
_logger.Log($"E-mail template not found: '{path}'. Can't send user generated passwords.");
return;
}
Rendering.Template tmpl = new Rendering.Template(path);

string fromEmail = _senderEmail;
if (!Core.Helpers.StringHelper.IsValidEmailAddress(fromEmail))
Expand Down

0 comments on commit 6785808

Please sign in to comment.