---
title: "Class TemplateVariable"
slug: "sdk--stylelabs.m.sdk.contracts.notifications.templatevariable"
abstract: ""
---
# Class TemplateVariable

Model for template variables in e-mail templates.

## Inheritance

object

TemplateVariable

## Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ContractsNotifications

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public class TemplateVariable
```

## Constructors

### TemplateVariable()

Initializes a new instance of the [TemplateVariable](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.templatevariable.html) class.

#### Declaration

```csharp
public TemplateVariable()
```

### TemplateVariable(JObject)

Initializes a new instance of the [TemplateVariable](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.templatevariable.html) class.

#### Declaration

```csharp
public TemplateVariable(JObject jObject)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| JObject | jObject | The property value. |

## Properties

### Name

Gets or sets name of the variable.

#### Declaration

```csharp
public string Name { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| string |  |

### Template

Gets or sets the template for the variable. For [DateTime](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.templatevariabletype.html) this can be a formatting, or it can be the name of the variable in the backend to be injected.

#### Declaration

```csharp
public string Template { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| string |  |

### Templated

Gets or sets whether the variable is a template. This means that the value is injected by the backend and/or needs formatting.

#### Declaration

```csharp
public bool? Templated { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| bool |  |

### VariableType

Gets or sets type of the variable.

#### Declaration

```csharp
public TemplateVariableType? VariableType { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [TemplateVariableType](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.templatevariabletype.html) |  |

## Methods

### GetJObject()

Gets the values of this object as an .

#### Declaration

```csharp
public JObject GetJObject()
```

#### Returns

| Type | Description |
| --- | --- |
| JObject | A . |
