Unable to register the email builder template

2025/07/02 6:25 PM

Hello friends

I'm currently trying to register an email builder template for newsletter on XbyK v30.6.1 using the following code in the file NewsletterEmailTemplate.razor.cs:

[assembly: RegisterEmailTemplate(NewsletterEmailTemplate.IDENTIFIER, "Newsletter Email Template", typeof(NewsletterEmailTemplate),
    Description = "Template for the newsletter email",
    IconClass = "icon-newspaper",
    ContentTypeNames = [NewsletterRelease.CONTENT_TYPE_NAME],
    PropertiesType = typeof(NewsletterEmailTemplateProperties))]

On the program.cs, I initialized the features.UseEmailBuilder(); and also configured it:

.Configure<EmailBuilderOptions>(options =>
{
    // Enter the code names of all email content types where you wish to use Email Builder
    options.AllowedEmailContentTypeNames = [nameof(NewsletterRelease.CONTENT_TYPE_NAME)];
    // Replace the default Email Builder section with the MJML full-width section provided by the Starter Kit
    options.RegisterDefaultSection = false;
    options.DefaultSectionIdentifier = FullWidthEmailSection.IDENTIFIER; 
})

I don't see any issues when building the project and when loading the admin site, I cannot see the template listed:

1.00



I'm not sure if this is a known bug or if I'm missing something. Also, if there is a way to enable debugging when the email templates are being registered on the startup, let me know, so I can enable it and share the logs. The event logs are empty on my side.

Any hint is always welcome! thank you

Tags:
Email Builder Xperience Administration v30.6.0

Answers

2025/07/02 7:07 PM

Hm, I think you've covered a lot of the steps correctly.

But, what about email purposes? Currently the Email Builder only supports Regular and Automation purposes.

We plan to add more in the future, but for now you can use Confirmation and Form autoresponder.

There's an easy workaround for Form autoresponder emails - use Automations instead and use the Email automation step to send the form submitter a confirmation email.

For recipient list confirmation emails, you'll need to continue using the macro-based template email templates until we support more purposes. This is what I'm doing in the Kentico Community Portal - all emails use the Email Builder except for the newsletter sign-up opt-in email, which is still using the old macro templates.

2025/07/02 7:15 PM
Answer

Thanks @Sean for the support and faster response, it was for a Regular purposes, however, it is nice to know what is supported currently, and the need to continue using macro based template emails. I just found the root cause of the issue:

.Configure<EmailBuilderOptions>(options =>
{
    // Enter the code names of all email content types where you wish to use Email Builder
    options.AllowedEmailContentTypeNames = [NewsletterRelease.CONTENT_TYPE_NAME];
    // Replace the default Email Builder section with the MJML full-width section provided by the Starter Kit
    options.RegisterDefaultSection = false;
    options.DefaultSectionIdentifier = FullWidthEmailSection.IDENTIFIER; 
})

I removed the nameof() on the options.AllowedEmailContentTypeNames property. For some reason that was added there, maybe since I got it from other repository samples.



Anyways, thanks for the help. Always posting things helps to see things we cannot see on the IDE. :)

2025/07/02 8:00 PM

Hah, nice catch! I've done that before in other areas of Xperience's API 😄.

To answer this question, you have to login first.