Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig100 1136 posts 2523 karma points c-trib
    Jul 07, 2023 @ 11:13
    Craig100
    0

    Unable to send Vendr Order Confirmation emails.

    Umb V10.5.1, Vendr V3.0.12, Vendr Checkout V3.0.1 & Vendr Deploy V3.0.0

    Unable to send Order Confirmation emails.

    Site running locally, proved can send Umbraco Forms emails. The site is multi-lingual with en-GB & ar-AE. None of the Vendr Umbraco parameters are set to vary by culture (as advised). No payment provider installed yet. Payment set to "Invoice" for now.

    When going through a purchase, at the point of clicking "Continue to Process Payment" on the Review Order page, while the page proceeds to the Order Confirmation page, in the background, there is the following exception:-

    System.AggregateException: AsyncHelper.RunSync method threw an exception. (Sequence contains no matching element)
     ---> System.InvalidOperationException: Sequence contains no matching element
       at System.Linq.ThrowHelper.ThrowNoMatchException()
       at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
       at AspNetCore.App_Plugins_VendrCheckout_views_emails_VendrCheckoutOrderConfirmationEmail.ExecuteAsync() in C:\DotNetSites\MyProject\dev-myproject\src\UmbracoProject\App_Plugins\VendrCheckout\views\emails\VendrCheckoutOrderConfirmationEmail.cshtml:line 29
       at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
       at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
       at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
       at Vendr.Common.Helpers.AsyncHelper.<>c__DisplayClass1_0.<<RunSync>b__0>d.MoveNext()
    

    ....and no email is sent.

    The section that's failing is:-

     26   var ctx = this.GetService<IUmbracoContextAccessor>().GetRequiredUmbracoContext();
     27   var checkoutContentType = ctx.Content.GetContentType("vendrCheckoutCheckoutPage");
     28   var checkoutPages = ctx.Content.GetByContentType(checkoutContentType);
     29   var checkoutPage = checkoutPages.First(x => x.GetStore()?.Id == Model.StoreId);
    

    On debug, Ln 27 checkoutContentType has the value of "vendrCheckoutCheckoutPage" correctly. Ln 28 fails to get any Content By Content Type of "vendrCheckoutCheckoutPage"

    As I understand it, it should just go back up the tree to find a page with the StoreId set. Which in this case is the Home page.

    The site structure is:-

     Home (containing StoreId in a "store" property)
        Shop
            Checkout
                Order Confirmation
    

    I'm assuming it's not an issue with Umbraco. But it's either Umbraco, Vendr or the site structure. The site structure looks ok to me, but is it?

    Any suggestions or ideas would be appreciated.

  • Craig100 1136 posts 2523 karma points c-trib
    Jul 07, 2023 @ 12:47
    Craig100
    0

    Doing some more debugging. The ONLY content type that produces an output in checkoutPages is if I replace "vendrCheckoutCheckoutPage" with "home", which is the home page alias. It will not pick up any other page alias at all. The upside is that the Confirmation email is now sent and populated correctly. The downside is, it's not particularly agile. This looks more and more like an issue with the IPublishedCache IEnumerable<IPublishedContent> GetByContentType(IPublishedContentType contentType). Is it broken in 10.5.1? Hard to imagine but not impossible. Might raise an issue, but I'd be interested to know what others think first.

  • Craig100 1136 posts 2523 karma points c-trib
    Jul 15, 2023 @ 09:16
    Craig100
    100

    The work around for now has been to copy the email templates from the App_Plugins folder to my main Views folder and alter the path to the templates in the Back Office at Settings > Vendr > Stores > MyStoreName > Templating > Email Templates > per email : Template View field.

    Then change line 27 from "vendrCheckoutCheckoutPage" to "home" (which is where my storeId is).

    Meanwhile have submitted an issue : https://github.com/umbraco/Umbraco-CMS/issues/14538

Please Sign in or register to post replies

Write your reply to:

Draft