diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln
index 3db0998855..97a831752c 100644
--- a/framework/Volo.Abp.sln
+++ b/framework/Volo.Abp.sln
@@ -277,7 +277,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Http.Client.Identi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.ObjectExtending", "src\Volo.Abp.ObjectExtending\Volo.Abp.ObjectExtending.csproj", "{D1815C77-16D6-4F99-8814-69065CD89FB3}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.ObjectExtending.Tests", "test\Volo.Abp.ObjectExtending.Tests\Volo.Abp.ObjectExtending.Tests.csproj", "{17F8CA89-D9A2-4863-A5BD-B8E4D2901FD5}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.ObjectExtending.Tests", "test\Volo.Abp.ObjectExtending.Tests\Volo.Abp.ObjectExtending.Tests.csproj", "{17F8CA89-D9A2-4863-A5BD-B8E4D2901FD5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.TextTemplating", "src\Volo.Abp.TextTemplating\Volo.Abp.TextTemplating.csproj", "{9E53F91F-EACD-4191-A487-E727741F1311}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -829,6 +831,10 @@ Global
{17F8CA89-D9A2-4863-A5BD-B8E4D2901FD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17F8CA89-D9A2-4863-A5BD-B8E4D2901FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17F8CA89-D9A2-4863-A5BD-B8E4D2901FD5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9E53F91F-EACD-4191-A487-E727741F1311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9E53F91F-EACD-4191-A487-E727741F1311}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9E53F91F-EACD-4191-A487-E727741F1311}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9E53F91F-EACD-4191-A487-E727741F1311}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -970,6 +976,7 @@ Global
{E1963439-2BE5-4DB5-8438-2A9A792A1ADA} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{D1815C77-16D6-4F99-8814-69065CD89FB3} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{17F8CA89-D9A2-4863-A5BD-B8E4D2901FD5} = {447C8A77-E5F0-4538-8687-7383196D04EA}
+ {9E53F91F-EACD-4191-A487-E727741F1311} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}
diff --git a/framework/src/Volo.Abp.TextTemplating/FodyWeavers.xml b/framework/src/Volo.Abp.TextTemplating/FodyWeavers.xml
new file mode 100644
index 0000000000..be0de3a908
--- /dev/null
+++ b/framework/src/Volo.Abp.TextTemplating/FodyWeavers.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.TextTemplating/FodyWeavers.xsd b/framework/src/Volo.Abp.TextTemplating/FodyWeavers.xsd
new file mode 100644
index 0000000000..3f3946e282
--- /dev/null
+++ b/framework/src/Volo.Abp.TextTemplating/FodyWeavers.xsd
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
+
+
+
+
+ A comma-separated list of error codes that can be safely ignored in assembly verification.
+
+
+
+
+ 'false' to turn off automatic generation of the XML Schema file.
+
+
+
+
+
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj b/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj
new file mode 100644
index 0000000000..cbc6ba05ec
--- /dev/null
+++ b/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+ netstandard2.0
+ Volo.Abp.TextTemplating
+ Volo.Abp.TextTemplating
+ $(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
+ false
+ false
+ false
+
+
+
+
+
+
+
+
diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/AbpTextTemplatingModule.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/AbpTextTemplatingModule.cs
new file mode 100644
index 0000000000..6b0ad6fb11
--- /dev/null
+++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/AbpTextTemplatingModule.cs
@@ -0,0 +1,9 @@
+using Volo.Abp.Modularity;
+
+namespace Volo.Abp.TextTemplating
+{
+ public class AbpTextTemplatingModule : AbpModule
+ {
+
+ }
+}
diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateContributorList.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateContributorList.cs
new file mode 100644
index 0000000000..44a91212ea
--- /dev/null
+++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateContributorList.cs
@@ -0,0 +1,22 @@
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Volo.Abp.Emailing.Templates
+{
+ public class EmailTemplateContributorList : List
+ {
+ public string GetOrNull(string cultureName)
+ {
+ foreach (var contributor in this.AsQueryable().Reverse())
+ {
+ var templateString = contributor.GetOrNull(cultureName);
+ if (templateString != null)
+ {
+ return templateString;
+ }
+ }
+
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateDefinition.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateDefinition.cs
new file mode 100644
index 0000000000..19f0eb2fa7
--- /dev/null
+++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateDefinition.cs
@@ -0,0 +1,36 @@
+using System;
+using JetBrains.Annotations;
+
+namespace Volo.Abp.Emailing.Templates
+{
+ public class EmailTemplateDefinition
+ {
+ public const string DefaultLayoutPlaceHolder = "_";
+
+ public string Name { get; }
+
+ public bool IsLayout { get; }
+
+ public string Layout { get; set; }
+
+ public Type LocalizationResource { get; set; }
+
+ public EmailTemplateContributorList Contributors { get; }
+
+ public string DefaultCultureName { get; }
+
+ public bool SingleTemplateFile { get; }
+
+ public EmailTemplateDefinition([NotNull] string name, Type localizationResource = null, bool isLayout = false,
+ string layout = DefaultLayoutPlaceHolder, string defaultCultureName = null, bool singleTemplateFile = false)
+ {
+ Name = Check.NotNullOrWhiteSpace(name, nameof(name));
+ LocalizationResource = localizationResource;
+ Contributors = new EmailTemplateContributorList();
+ IsLayout = isLayout;
+ Layout = layout;
+ DefaultCultureName = defaultCultureName;
+ SingleTemplateFile = singleTemplateFile;
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateInitializationContext.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateInitializationContext.cs
new file mode 100644
index 0000000000..8cd4b95bbd
--- /dev/null
+++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/EmailTemplateInitializationContext.cs
@@ -0,0 +1,18 @@
+using System;
+
+namespace Volo.Abp.Emailing.Templates
+{
+ public class EmailTemplateInitializationContext
+ {
+ public EmailTemplateDefinition EmailTemplateDefinition { get; }
+
+ public IServiceProvider ServiceProvider { get; }
+
+ public EmailTemplateInitializationContext(EmailTemplateDefinition emailTemplateDefinition,
+ IServiceProvider serviceProvider)
+ {
+ EmailTemplateDefinition = emailTemplateDefinition;
+ ServiceProvider = serviceProvider;
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/IEmailTemplateContributor.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/IEmailTemplateContributor.cs
new file mode 100644
index 0000000000..d2c2775845
--- /dev/null
+++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/IEmailTemplateContributor.cs
@@ -0,0 +1,9 @@
+namespace Volo.Abp.Emailing.Templates
+{
+ public interface IEmailTemplateContributor
+ {
+ void Initialize(EmailTemplateInitializationContext context);
+
+ string GetOrNull(string cultureName);
+ }
+}
\ No newline at end of file
diff --git a/nupkg/common.ps1 b/nupkg/common.ps1
index f9e1263908..9c77b05eef 100644
--- a/nupkg/common.ps1
+++ b/nupkg/common.ps1
@@ -101,6 +101,7 @@ $projects = (
"framework/src/Volo.Abp.Sms",
"framework/src/Volo.Abp.Specifications",
"framework/src/Volo.Abp.TestBase",
+ "framework/src/Volo.Abp.TextTemplating",
"framework/src/Volo.Abp.Threading",
"framework/src/Volo.Abp.Timing",
"framework/src/Volo.Abp.UI",