Thank you, Liangshiwei. It works.
Hi mate, Thank you for supporting. The issue is of sanitization and I have solved it.
The binding model works fine with the layout template without content template. But I got an error when binding the model to the layout template with content template. Here is my method:
public virtual async Task<string> GetTemplateAsync(GetEmailTemplateInput input)
{
var currentLanguage = CultureInfo.CurrentCulture.Name;
var corp = ObjectMapper.Map<Corporation, CorporationDto>(await _corporationRepository.GetAsync(input.CorporationId!.Value));
if (corp == null)
{
return await _templateRenderer.RenderAsync(input.TemplateName, new { }, currentLanguage);
}
if (currentLanguage != LocalizationConsts.DefaultLanguage)
{
corp = corp.Translate(currentLanguage);
}
var model = new EmailLayoutTemplate
{
Title = corp.Title != null ? corp.Title : string.Empty,
Address = corp.Address != null ? corp.Address : string.Empty,
Email = corp.Email != null ? corp.Email : string.Empty,
Phone = corp.Phone != null ? corp.Phone : string.Empty,
Website = corp.Website != null ? corp.Website : string.Empty
};
return await _templateRenderer.RenderAsync(input.TemplateName, model, currentLanguage);
}
I've debuged (the para model is not null and has properties) and found that the error occured at the last line: _templateRenderer.RenderAsync(input.TemplateName, model, currentLanguage); I'm not sure whether the _templateRenderer.RenderAsync() supports binding to the layout template? Please, help me sovle this issue.
Here is the error log:
2024-03-13 23:28:55.361 +07:00 [ERR] ---------- RemoteServiceErrorInfo ----------
{
"code": null,
"message": "An internal error occurred during your request!",
"details": null,
"data": {},
"validationErrors": null
}
2024-03-13 23:28:55.363 +07:00 [ERR] <input>(9,41) : error : Cannot get the member model.title for a null object.
<input>(9,41) : error : Cannot get the member model.title for a null object.
2024-03-13 23:28:55.369 +07:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
2024-03-13 23:28:55.370 +07:00 [INF] Executed action LogiPlat.Controllers.MailMessages.MailMessageController.GetTemplateAsync (LogiPlat.HttpApi) in 3278.8221ms
2024-03-13 23:28:55.370 +07:00 [INF] Executed endpoint 'LogiPlat.Controllers.MailMessages.MailMessageController.GetTemplateAsync (LogiPlat.HttpApi)'
2024-03-13 23:28:55.498 +07:00 [INF] Request finished HTTP/2 GET https://localhost:44343/template?templateName=LogiPlat.Email.Confirmation&corporationId=37d67126-bb7b-90f0-f5ab-3a1103be317d - - - 500 - application/json;+charset=utf-8 3417.4624ms
Hi Liangshiwei,
We don’t want to customize the source code as we need to upgrade to the newer abp versions. Does the Chat module support extra properties configuration like other module? If yes, show us how to configure to add more properties to the Message entity. If the Chat module does not support configuring extra properties, please advise us the best way to add more properties to the Message entity so that we could update to the newer abp version without reimplementing to code. Thank you in advance
Hi Anjali,
Thank you very much for your support. By the way, could you please show me how to programatically select the menu item on the left-side menu?
Best Regards
Hello Anjali,
I have checked the document, but it is about replacing a whole built-in component with a new component. I don’t want to replace the whole toolbar component. I just want to add a new item to the current built-in toolbar. Please advise me how to do this with best practices as abp patterns. Best Regards
Hi,
1.
You can manually change the version from
7.4.2
to7.4.3
2.
You can try deleted node_modules,package-lock.json, and try
yarn install
again.
Should you fix this bug?
Hi, I suppose you guys should take this requirement as an improvement.
Hi
BTW, I have tested ABP Commercial version 7.4.0 RC.1 (Angular UI). This version has duplicate breadcrum (see image). And this duplicate breadcrum also makes the UI ugly in mobile screen. I suppose it would be better to replace the second breadcrum after the Page Title with a small info message (if any).