Custom message template based on shipment method

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi!
I have several shipment method and i want create message for each shipment option own message template.
Could u please tell how can i make it?
6 years ago
Would you clarify "create message"?  Is that for the 'order placed' email, or display on shipping method selection page, or display on final checkout?  etc?
6 years ago
I wold like to use something like https://github.com/BeniGemperle/nopCommerce-RazorMessageService
So on action shipment ShipmentSent i would like to send different type of message based on shipment method. Body and text should be different. I see that this service allow me to make in a simpleway like if - else but i dont get how to load a Layout

@{
Layout = "~/Views/_ColumnsOne.cshtml";
}

This returns me en eror

@{ Layout = "~/Views/_ColumnsOne.cshtml"; }RazorParseException: Please either set a template manager to resolve templates or add the template '~/Views/_ColumnsOne.cshtml'! at RazorEngine.Templating.DelegateTemplateManager.<>c.b__3_0(String name) at RazorEngine.Templating.DelegateTemplateManager.Resolve(ITemplateKey key) at RazorEngine.Templating.RazorEngineCore.Resolve(ITemplateKey key) at RazorEngine.Templating.RazorEngineCore.Compile(ITemplateKey key, Type modelType) at RazorEngine.Templating.RazorEngineCoreWithCache.ResolveInternal(String cacheName, Object model, Type modelType, DynamicViewBag viewbag, ResolveType resolveType, ITemplateKey context) at RazorEngine.Templating.InternalTemplateService.Resolve(String name, Object model, Type modelType, DynamicViewBag viewbag, ResolveType resolveType) at RazorEngine.Templating.TemplateBase`1.ResolveLayout(String name) at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String templateSource, String name, Type modelType, Object model, DynamicViewBag viewBag) at Nop.Plugins.RazorMessageService.Services.RazorTemplateParser.ParseSafe(Int32 templateId, String text, Object model, Boolean& success)
6 years ago
Oke i fix this one - but still have  a problem. I want to send nice and cool email with adaptive design etc.
But i limit to 4000 symbolos coz body keeped in DB as a string.
So i have a question - where is a settings to make make it simmilar as picutures?
6 years ago
art_MOO wrote:
... limit to 4000 symbolos coz body keeped in DB as a string...

The MessageTemplate.Body is nvarchar(max)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.