nodeDescription="Transforms message to email message",
nodeDetails="Transforms message to email message. All email fields support templatization.<br><br>"+
"Additionally, supports adding inline base64 images to the mail body from message metadata "+
"by extracting them from <strong><i>images</i></strong> metadata key-value.<br>"+
"<strong><i>images</strong></i> key-value should represent a map of entries: <strong><i>cid --> encodedImage</i></strong>.<br>"+
"E.g., <strong><i>cid</i></strong> is a <strong><i>tb.example.png</i></strong> and<br>"+
"<strong><i>encodedImage</i></strong> is a <strong><i>data:image/png;base64,...</i></strong>, "+
"then you can use <i><strong>img</i></strong> HTML tag with src: <i><strong>cid:tb.example.png</i></strong>.<br><br>"+
"Set <code>SEND_EMAIL</code> output message type if transformation completed successfully.<br><br>"+
nodeDetails="Transforms message to email message. If transformation completed successfully output message type will be set to <code>SEND_EMAIL</code>.<br><br>"+
Imagine that you receive the message defined below from the `Temperature` sensor
and forwarded it to the **change originator** node with configuration added above.
- incoming message definition:
```json
{
"msg": {
"temperature": 32
},
"metadata": {
"deviceType": "Temperature",
"deviceName": "TH-001",
"ts": "1685379440000"
}
}
```
<br>
The same example for the `humidity` sensor:
- incoming message definition:
```json
{
"msg": {
"humidity": 77
},
"metadata": {
"deviceType": "Humidity",
"deviceName": "HM-001",
"ts": "1685379440000"
}
}
```
<br>
To demonstrate that the originator was changed based on rule node configuration, the screenshots with debug events captured for the **change originator** rule node will be added below:
- Debug events for processed message from the `Temperature` sensor:
In the debug events displayed, the `IN` message points to the incoming message received by the node,
with the originator type specified as `DEVICE`. This reflects the message from the actual sensor (e.g., a `Temperature` or `Humidity` sensor).
After processing through the `change originator` rule node, the `OUT` message has an originator type of `ASSET`,
indicating that the message originator has been successfully changed to the corresponding managing asset, such as `TemperatureManager` or `HumidityManager`.
<br>
These examples showcases using the **change originator** node with dynamic configuration based on the substitution of metadata fields.
Fields templatization feature allows you to process the incoming messages with dynamic configuration by substitution templates specified in the configuration fields with values from message or message metadata.
Fields templatization feature allows you to process the incoming messages with dynamic configuration
by substitution of templates specified in the configuration fields with values from message or message metadata.
For more detailed information, please refer to the ThingsBoard [documentation](https://thingsboard.io/docs/user-guide/templatization/)
There are two types of rule node configuration templates defined:
- `$[messageKey]` - templates with square brackets used to extract value from the message.
- `${metadataKey}` - templates with curly brackets used to extract value from the message metadata.
**Note:** `messageKey` and `metadataKey` are just samples of key names that might exist in the message or metadata.