Azure Email Communication Services feature, Shortcode for cache busting - This week in Orchard (08/12/2023)

Gábor Domonkos's avatar
Admin UI, Documentation, This week in Orchard, Shortcodes, Admin Dashboard, Admin Dashboard Widgets

Shortcode for cache busing, update the Admin Dashboard documentation, and a demo about the upcoming Azure Email Communication Services feature! Let's get started!

Orchard Core updates

Update the Admin Dashboard documentation

The documentation page for the Admin Dashboard has been updated with details about how to create custom widgets that you can add to the Admin Dashboard. You can also read about the customizable settings of these widgets and the options that you can use if you wish to modify the look of your widgets.

Admin Dashboard updated documentation

Shortcode for cache busting

There was no option to add a Shortcode for cache busting. For reference, you can add cache busting in a cshtml file like this: @Orchard.AssetUrl(assetPath: path, appendVersion: true).

So, if somebody used an image in (for example) an HTML Body part, there was no way to add cache busting with a Shortcode. The goal of this improvement was to add a Shortcode that allows cache busting.

The Shortcodes page of the documentation lists the available Shortcodes in Orchard Core. This contains the [image] shortcode as well that renders an image from the site's media library. From now on, you can use the append_version parameter when utilizing the [image] Shortcode.

The append_version parameter of the image Shortcode


Azure Email Communication Services feature

Azure now has a new set of resources under the Communication Services (ACS) umbrella, Email Communication Services being one of them. This is a cheaper, Azure-native alternative to SendGrid.

The primary way to use it is not through traditional SMTP-server configuration, but a connection string (of two components, endpoint, and access key) provided by the ACS resource, which allows access to the specific communication service resources attached to it (for example, an Email Communication Services instance). This requires a custom implementation to send emails using the corresponding SDK. OrchardCore.Email doesn't seem to support this scenario at its current state and needs a bit of refactoring (can take inspiration from the structure in O1 for better extensibility).

Now let's see the current state of this feature that you can also check out in this PR! First, we need to enable the Azure Email Communication Services feature that configures email settings and a default email service based on (ACS) under the Configuration -> Features option from the admin UI. After that, you will find a new option under Configuration -> Settings -> Email, called Azure Email Settings.

Azure email options

Here, you can see the Default Sender and the Connection String values. The Default Sender can be set up under the Email Settings menu item or use the appsettings.json file. The Connection String can be set up using the appsettings.json file. And if you are interested in how to use this feature from code, you can see a unit test for this in the AzureEmailServiceTests class.

The AzureEmailServiceTests class

As always, if you would like to know more about this upcoming feature, head to YouTube for a recording!

News from the community

Orchard Dojo Newsletter

Lombiq's Orchard Dojo Newsletter has 487 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course.

Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here!

If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

No Comments

Add a Comment