Dynamic Content Documentation
InsertRow method allows inserting a single row in a custom data table. This is an equivalent of SQL INSERT query.
This method is useful if you need to save some particular data related to each sent email, e.g. date or GUID.
InsertRow(table, columns, values)
Parameter definition:
You can call InsertRow method using curly braces syntax. You may put in anywhere in the email template code since its output is empty string.
Example 1 - the most simple call
${InsertRow('MyTable', new string[] {'MyColumn'}, new object[] {'foobar'})}
Equivalent SQL query:
INSERT INTO MyTable (MyColumn) VALUES ('foobar')
This assumes we have a simple table with one column.
Example 2 - inserting a record to table with multiple columns of different types
${InsertRow('MyTable', new string[] {'MyIntColumn', 'MyTextColumn', 'MyDateColumn'}, new object[] {123, 'foobar', new System.DateTime(2015, 1, 26, 14, 0, 0)})}
Equivalent SQL query:
INSERT INTO MyTable (MyIntColumn, MyTextColumn, MyDateColumn) VALUES (123, 'foobar', '2015-01-26 14:00:00')
Of course, it is possible to use any of available predefined variables, snippets or subscriber properties as inserted values.