0

How does one send a templated Postmark message on ASP.NET? I'd imagine it would be done in this way:

TemplatedPostmarkMessage message = new TemplatedPostmarkMessage
{
    From = "demo@demo.com",
    To = "someone@else.com",
    TemplateId = 1738,
    TemplateModel = some_passed_in_model
};

The question now arises, what exactly is TemplateModel? From the API on Postmark's site, it seems like a JSON object, but in the definition from the DLL, it's as follows:

public object TemplateModel { get; set; }

I tried creating my own object with variable names that correspond to those on the Postmark template, however that does not work (it just sends a blank template). Postmark also does not have any documentation on how to use TemplatedPostmarkMessage in ASP.NET yet.

Sergey Smirnov
  • 303
  • 4
  • 11

1 Answers1

0

We send a dictionary of <string, object>, I believe you can use more complex models but a dictionary will get the job done.

Inverted Llama
  • 1,522
  • 3
  • 14
  • 25