Copied to clipboard

Flag this post as spam?

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


  • Steve Morgan 1350 posts 4460 karma points c-trib
    Jan 04, 2022 @ 16:12
    Steve Morgan
    0

    Email Confirmation Template

    Hi,

    Looking at the work involved in transplanting a TC site into Umbraco v9 and Vendr.

    One customisation they have is some text that they can update in their site settings node in Umbraco that is inserted into the email confirmations - useful for public holidays and delivery delays etc.

    How do I get an Umbraco Helper in the OrderConfirmationEmail.cshtml - is there anything in the VendrApi?

    Steve

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 04, 2022 @ 17:33
    Matt Brailsford
    100

    Hi Steve,

    You can find an example in the Vendr Checkout source https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Web/UI/App_Plugins/VendrCheckout/views/emails/VendrCheckoutOrderConfirmationEmail.cshtml#L26 this uses a custom helper extension to resolve services which you can find here https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Web/RazorPageExtensions.cs#L17 (you don’t need that helper if you copy the line highlighted, we need it to hide v8 + v9 api inconsistencies)

  • Steve Morgan 1350 posts 4460 karma points c-trib
    Jan 06, 2022 @ 10:33
    Steve Morgan
    0

    Wonderful. Another barrier to transplant down!

    And that checkout repo looks super useful.

    Thanks Matt.

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

    But how do you prevent the modified email templates being overwritten by Nuget restore on a restart?

    Yes you can copy the whole Checkout/Views contents to your Views folder and add a route in appsettings, but then innocent tags get incorrectly interpreted as tag helpers and blow up.

    Any suggestions?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 11, 2023 @ 14:12
    Matt Brailsford
    1

    You could move just the email templates into your Views folder and update the email template View Path settings in the back office to point to your templates rather the default ones.

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

    When I tried that, it seemed that I had to move ALL the views and add an appsetting:-

    "VendrCheckout" : { "RootViewPath" : "/Views/VendrCheckoutViews" },

    And then I hit the issue with the tag helpers.

    Ah, I see now, it's this field here:- enter image description here

    Fantastic, thanks. That allows emails to be sent while Umbraco look at this little problem ;) https://github.com/umbraco/Umbraco-CMS/issues/14538

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies