# to email transformation

<div align="left"><img src="https://111806075-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg4otljWU9FsHKYhTsW%2Fuploads%2FccHzp4k1g2rLvz9DlfKM%2Fimage.png?alt=media&#x26;token=5d2ee11d-dc70-4936-945e-99ff2ff9ebc2" alt=""></div>

Transforms message to Email Message by populating email fields using values derived from Message metadata. Set ‘SEND\_EMAIL’ output Message type that can be accepted later by [**Send Email Node**.](https://docs.tesenso.com/tesenso-iot-cloud/rule-engine/rule-engine/output-connectors/send-email) All email fields can be configured to use values from metadata.

<div align="left"><img src="https://thingsboard.io/images/user-guide/rule-engine-2-0/nodes/transformation-to-email-config.png" alt="image"></div>

For example incoming message has **deviceName** field in metadata and email body should contain its value.

In this case value of **deviceName** can be referenced as `${deviceName}` like in the following example:

```javascript
 Device ${deviceName} has high temperature
```

Additionally this node can prepare email attachments if incoming message metadata contains **attachments** field with reference to files stored in DataBase.
