# Notifications

## Notification templates

Notification templates are text files with HTML content and WorkflowGen macros. The default notification templates are located in the `\wfgen\App_Data\Templates\Emails` folder.

<div align="left"><img src="/files/-LQ3jcml1HPmvh2LOYup" alt=""></div>

The stylesheet must be embedded in the template. You can attach a file to the notification via the `<WF_PROCESS_INST_RELDATA_FILE.YOURPROCESSDATANAME>` macro.

#### 📌 Example of notification template HTML code (body section)

```markup
...
   <body>
        <table class="Header" cellpadding="0" cellspacing="0">
            <tr>
                <td class="Title"><WF_PROCESS_INST_NAME></td>
            </tr>
        </table>
        <table class="Content">
            <tr>
                <td class="FieldLabel">Subject:</td>
                <td class="FieldValue">A new action that you can handle has been created.</td>
            </tr>
            <tr>
                <td class="FieldLabel">Action:</td>
                <td class="FieldValue"><WF_ACTIVITY_INST_NAME></td>
            </tr>
            <tr>
                <td class="FieldLabel">Description:</td>
                <td class="FieldValue"><WF_ACTIVITY_INST_DESC></td>
            </tr>
            <tr>
                <td class="FieldLabel">Link:</td>
                <td class="FieldValue">
                    <a class="Link" href="<WF_LINK_ACTIVITY_INST_FORM>">View action</a>
                </td>
            </tr>
        </table>
        <table class="DataList" cellpadding="0" cellspacing="0">
            <tr>
                <td class="Header" colspan="2">Associated data:</td>
            </tr>
            <WF_PROCESS_INST_RELDATA>
            <tr class="ListRow" onmouseover="this.className='ListRowHighLight'" onmouseout="this.className='ListRow'">
                <td class="FieldLabel"><WF_KEY></td>
                <td class="FieldValue">&nbsp;<WF_VALUE></td>
            </tr>
            </WF_PROCESS_INST_RELDATA>
        </table>
        <WF_PROCESS_INST_RELDATA_FILE.FORM_ARCHIVE>
    </body>
...
```

You can also use a custom notification template in a process data and use this process data in an additional notification of a workflow action.

<div align="left"><figure><img src="/files/SNj4k4ON4VpRGxbZTJIk" alt=""><figcaption></figcaption></figure></div>

For more information, see the [Custom Notification Templates](https://docs.advantys.com/workflowgen-administration-module-reference-guide/custom-notification-templates) section in the [WorkflowGen Administration Guide](https://docs.advantys.com/workflowgen-administration-module-reference-guide/).

## SMTP gateway

We recommend using the local IIS SMTP server. There are several advantages to using an SMTP relay at the IIS WorkflowGen server:

* Better performance, since messages are sent directly to the relay.
* Local SMTP acts as a buffer to avoid loss of emails if the main SMTP server is not available.
* Connection problems are reduced because the relay manages communication problems.
* The relay traces email deliveries in its own log files.
* The relay allows you to limit access to WorkflowGen.
* The relay supports SMTP authentication and encryption (TLS encryption) to connect to your Exchange SMTP (or other mail server).

WorkflowGen supports pickup directories for best performance and availability. This means that the notifications are created in a pickup directory managed by the SMTP server. IIS SMTP server and Exchange support pickup directory management.

For more information, see [SMTP Notifications](https://docs.advantys.com/workflowgen-technical-reference-guide/using-iis-smtp-gateway) in the [WorkflowGen Technical Guide](https://docs.advantys.com/workflowgen-technical-reference-guide/).

<div align="left"><img src="/files/-LQ3jcmp_cPC0PS1AlAv" alt=""></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.workflowgen.com/integration/9.0/notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
