/// <summary>
        /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        /// Refer to this article for correct order of middleware calls: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-3.1.
        /// </summary>
        /// <param name="app">This object corresponds to the current running application.</param>
        /// <param name="env">Our web hosting environment.</param>
        /// <param name="mtoaServices">Mtoa services to initialize application settings.</param>
        public static void Configure(IApplicationBuilder app, IWebHostEnvironment env, IMtoaServices mtoaServices)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");

                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseStaticFiles();
            app.UsePageSettingsMiddleware();
            app.UseRequestLocalization(); // if GoC.WebTemplate-Components.Core (in NuGet) >= v2.1.1
            app.UseRouting();

            app.UseEndpoints(
                endpoints =>
            {
                endpoints.MapBlazorHub();
                endpoints.MapFallbackToPage("/_Host");
            });

            // update/create the MTOA submission email template
            if (mtoaServices != null)
            {
                InitializeMtoaEmailTemplatesAsync(mtoaServices);
            }
        }
 private static async Task InitializeMtoaEmailTemplatesAsync(IMtoaServices mtoaServices)
 {
     await mtoaServices.PostSubmissionEmailNotificationTemplateAsync().ConfigureAwait(false);
 }