How do you create and send a new customized email in a similar pattern to the OrderConfirmationEmail?
I have:
- Created a new email template following the documentation “Add new email template” at [1] (renamed copy of ConfirmationEmail.html)…
- Added the new class name as a field in PageTemplateNameConstants.cs.
- Created and renamed a copy of OrderConfirmationPageByFieldTemplateCache in PageByFieldTemplateCache.cs assigning the field Name with the value of the new field in PageTemplateNameConstants.cs
- Created a copy of OrderConfirmationPageTemplateSetup.cs replacing the parameter PageTemplateNameConstants.OrderConfirmation with the new field added above and changing the class and file names to reflect its new purpose.
- Created a copy of OrderConfirmationEmail.cs replacing OrderConfirmationPageByFieldTemplateCache with my new class and renamed the class and file names.
- Added a new mapping to _controllerMapping in FieldTemplateSetupDecorator.cs with the area type WebsiteArea, id as the value of the new field in the PageTemplateNameConstants, controller type as the OrderController and the action as the name of a new function in OrderController.
- Added a new [HttpGet] function to OrderController.cs with the same name as the above mentioned action string and following the same pattern as the Confirmation function in the same file.
- Added IoC.Resolve().SendEmail(…) with my new email class as an entry action to OrderState.WaitingConfirmation.
In this scenario OrderConfirmationEmail works, however, the copy does not. The issue appears to be that Page cannot be retrieved in the OrderConfirmationEmail class copy, it fails at or near TryGetPage. I would guess that the new email page is not registered properly, and I am not sure how I would do that correctly.
Litium version: 7.1