Skip to content

Commit e1fc861

Browse files
committed
Update Post.md
1 parent b7e3d6c commit e1fc861

File tree

1 file changed

+69
-7
lines changed
  • docs/en/Blog-Posts/2020-05-08 v2_7_Release

1 file changed

+69
-7
lines changed

docs/en/Blog-Posts/2020-05-08 v2_7_Release/Post.md

+69-7
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ We've completed & merged hundreds of issues and pull requests with **1,300+ comm
1212

1313
ABP.IO Platform is rapidly growing and we are getting more and more contributions from the community.
1414

15-
## What's New?
16-
17-
In the last few releases, we've mostly focused on providing ways to extend existing modules when you use them as NuGet/NPM Packages. We've also added some useful features and some helpful guides.
15+
## What's New in the ABP Framework?
1816

1917
### Object Extending System
2018

19+
In the last few releases, we've mostly focused on providing ways to extend existing modules when you use them as NuGet/NPM Packages.
20+
2121
The Object Extending System allows module developers to create extensible modules and allows application developers to customize and extend a module easily.
2222

2323
For example, you can add two extension properties to the user entity of the identity module:
@@ -66,10 +66,72 @@ ObjectExtensionManager.Instance
6666

6767
See the [Object Extensions document](https://docs.abp.io/en/abp/latest/Object-Extensions) for details about this system.
6868

69-
### Guide: Customizing the Existing Modules
69+
### Text Templating Package
70+
71+
[Volo.Abp.TextTemplating](https://www.nuget.org/packages/Volo.Abp.TextTemplating) is a new package introduced with the v2.7.0. Previously, [Volo.Abp.Emailing](https://www.nuget.org/packages/Volo.Abp.Emailing) package had a similar functionality but it was limited, experimental and tightly coupled to the emailing.
72+
73+
The new text templating package allows you to define text based templates those can be easily localized and reused. You can define layout templates and share the layout from other templates.
74+
75+
We are currently using it for email sending. A module needs to send an email typically defines a template. Example:
76+
77+
````xml
78+
<h3>{{L "PasswordReset"}}</h3>
79+
80+
<p>{{L "PasswordResetInfoInEmail"}}</p>
81+
82+
<div>
83+
<a href="{{model.link}}">{{L "ResetMyPassword"}}</a>
84+
</div>
85+
````
86+
87+
This is a typical password reset email template.
88+
89+
* The template system is based on the open source [Scriban library](https://github.com/lunet-io/scriban). So it supports if conditions, loops and much more.
90+
* `model` is used to pass data to the template (just like the ASP.NET Core MVC).
91+
* `L` is a special function that localizes the given string.
92+
93+
It is typical to use the same layout for all emails. So, you can define a layout template. This is the standard layout template comes with the framework:
94+
95+
````xml
96+
<!DOCTYPE html>
97+
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
98+
<head>
99+
<meta charset="utf-8" />
100+
</head>
101+
<body>
102+
{{content}}
103+
</body>
104+
</html>
105+
````
106+
107+
A layout should have a `{{content}}` area to render the child content (just like the `RenderBody()` in the MVC).
108+
109+
It is very easy to override a template content by the final application to customize it.
110+
111+
Whenever you need to render a template, use the `ITemplateRenderer` service by providing the template name and a model. See the [text templating documentation](https://docs.abp.io/en/abp/latest/Text-Templating) for details. We've even created a UI for the ABP Commercial (see the related section below).
112+
113+
### Subscribing to the Exceptions
114+
115+
ABP Framework's [exception handling system](https://docs.abp.io/en/abp/latest/Exception-Handling) automatically handles exceptions and returns an appropriate result to the client. In some cases, you may want to have a callback that is notified whenever an exception occurs. In this way, for example, you can send an email or take any action based on the exception.
116+
117+
Just create a class derived from the `ExceptionSubscriber` class in your application:
118+
119+
````csharp
120+
public class MyExceptionSubscriber : ExceptionSubscriber
121+
{
122+
public override async Task HandleAsync(ExceptionNotificationContext context)
123+
{
124+
//TODO...
125+
}
126+
}
127+
````
128+
129+
See the [exception handling](https://docs.abp.io/en/abp/latest/Exception-Handling) document for more.
130+
131+
### Others
70132

71-
[Customizing the Existing Modules guide](https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Guide) explains all the ways of extending/customizing a reusable module including [entities](https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities), [services](https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services) and the [user interface](https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-User-Interface).
133+
There are many minor features and enhancements made to the framework in the past releases. Here, a few ones:
72134

73-
### Guide: EF Core Database Migrations
135+
* Added `AbpLocalizationOptions.DefaultResourceType` to set the default resource type for the application. In this way, the localization system uses the default resource whenever the resource was not specified. The latest application startup template already configures it, but you may want to set it for your existing applications.
136+
* Added `IsEnabled` to permission definition. In this way, you can completely disable a permission and hide the related functionality from the application. This can be a way of feature switch for some applications. See [#3486](https://github.com/abpframework/abp/issues/3486) for usage.
74137

75-
TODO

0 commit comments

Comments
 (0)