Cannot get email template to do anything.

64 views
Skip to first unread message

Wayne Brantley

unread,
Nov 12, 2014, 7:00:23 PM11/12/14
to get...@googlegroups.com
https://github.com/continuousit/seq-apps/blob/master/src/Seq.App.Email/QuickStache/IdentifierTemplateToken.cs

Using the code above for reference, I can put this in the template:
{{@Exception}} or {{@RenderedMessage}} and they work....but nothing else works.

{{Id}} does not renders blank anything.
{{Links.Self}} does not render anything.

Trying to get the Message and the ExceptionClassName out of something like this I could not get to work either, but of course since simple ones do not work, that makes sense.

{"Name":"ExceptionDetail","Value":{"ExceptionClassName":"System.NullReferenceException","$Type":"System.NullReferenceException","HResult":-2147467261.0,"Message":"Object reference not set to an instance of an object.","Source":"WebPortal","TargetSite":"Void OnActionExecuting(System.Web.Mvc.ActionExecutingContext)"}


In short I cannot get anything other than the @ words listed in the source above to render.

Any ideas?




nblum...@nblumhardt.com

unread,
Nov 14, 2014, 7:40:28 PM11/14/14
to get...@googlegroups.com
Hi Wayne - simple properties like {{Application}} are working for me, can you please send a screenshot of the template you have configured, the (expanded) event being processed, and the output you get please? Many thanks!

Nick

Wayne Brantley

unread,
Nov 17, 2014, 6:08:20 PM11/17/14
to get...@googlegroups.com
Yes, {{Application}} works  - and most 'user added properties' that are simple will work.  Take this template for example:


{{ExceptionDetail.Message}}
{{ExceptionDetail.ExceptionClassName}}
{{ExceptionDetail.Value.ExceptionClassName}}
{{Links.Self}}

Request:{{HttpRequestRawUrl}}
{{Id}}
{{@Id}}

{{ApplicationName}} - {{Environment}} - {{Version}}
{{@RenderedMessage}}

The simple properties such as ApplicationName, Environment, Version and HttpRequestRawUrl all work.
However, {{Id}} is a simple property and it does not work.  Also, none of the 'dot notation' properties work.

Also, the handlebar looping and such would be nice to be able to loop through collections, etc.

In the above example, the email that comes back has REMOVED the {Id} tokens and replaced them with whitespace I suppose.
It has left others alone and you get:

{{ExceptionDetail.Message}}

{{ExceptionDetail.ExceptionClassName}}

{{ExceptionDetail.Value.ExceptionClassName}}

{{Links.Self}}


Main things I need to be able to are
   1)  use dot notation to get data out
   2)  A way to iterate all the properties of the message and output them in a table or whatever, including sub collections. (like you did in code).  Do handlebars or let me provide jscript or something.
   3)  Fix the {{Id}} to work

BTW, the default email you send, if that could be much more professional it would be good selling 'wow' feature...

nblum...@nblumhardt.com

unread,
Mar 7, 2015, 10:04:22 PM3/7/15
to get...@googlegroups.com
Just to follow up on this - the new Email+ app has all of the capabilities discussed below, and a much nicer default template. You can install it as Seq.App.EmailPlus, and check out the default template via its GitHub project: https://github.com/continuousit/seq-apps.

Cheers all!
Reply all
Reply to author
Forward
0 new messages