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?
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.
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.
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
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)
Wonderful. Another barrier to transplant down!
And that checkout repo looks super useful.
Thanks Matt.
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?
You could move just the email templates into your
Views
folder and update the email templateView Path
settings in the back office to point to your templates rather the default ones.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:-
Fantastic, thanks. That allows emails to be sent while Umbraco look at this little problem ;) https://github.com/umbraco/Umbraco-CMS/issues/14538
is working on a reply...