Starts in:
2 DAYS
11 HRS
9 MIN
23 SEC
Starts in:
2 D
11 H
9 M
23 S
Open Closed

Override Email Confirmation Template #6653


User avatar
0
Spospisil created
  • ABP Framework version: v7.3.0
  • UI Type: Blazor WASM
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Tiered/Separated Auth Server: Yes

Hi,

I am trying to override the standard email confirmation link that gets sent Account.Pro.Public ABP module. Following the documentation (https://docs.abp.io/en/abp/7.3/Text-Templating-Scriban) I added the .tpl file to my application.contracts project under the Emailing/Templates folder and then specificed a TemplateDefinitionProvider class to get the email confirmation definition and change it's virtual file path to where I have my custom .tpl file.

When the email gets rendered it's giving me a 'Volo.Abp.AbpException: Could not find a file/folder at the location: /Emailing/Templates/EmailConfirmationLink.tpl' error. The EmailConfirmationLink.tpl file is set to be an embedded resource and my ApplicationModule class has the configuration of the virtual file system.

Any suggestions would be helpful.

public class EmailTemplateDefinitionProvider : TemplateDefinitionProvider, ITransientDependency { public override void Define(ITemplateDefinitionContext context) { var emailNewUserConfirmation = context.GetOrNull(AccountEmailTemplates.EmailConfirmationLink);

    emailNewUserConfirmation
            .WithVirtualFilePath(
                "/Emailing/Templates/EmailConfirmationLink.tpl",
                isInlineLocalized: true);

}

}

public override void ConfigureServices(ServiceConfigurationContext context) { Configure<AbpVirtualFileSystemOptions>(options => { options.FileSets.AddEmbedded<xxxxxxApplicationContractsModule>(); }); }


No answer yet!
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06