Send DNN Message
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Sends a message through the DNN messaging system. The message lands in the recipients' DNN inbox, not directly in their email. You can send it to users, to roles, or both, and attach portal files.
The message follows DNN's own messaging settings and rules. For example, whether recipients also get an email copy depends on DNN's messaging settings and each user's notification preferences.
Typical Use Cases
- Notify a manager in their site inbox when a request is submitted
- Send a message to everyone in a role, for example
Approvers - Send a file, such as a generated report, to a user's inbox
- Keep the message ID in a token, for example to store it with the record
Don't use it to
- Send an email. Use Send Email instead.
- Show a message on the page. Use Display Message instead.
Related Actions
| Action Name | Description |
|---|---|
| Send Email | Sends an email through SMTP. |
| Send Slack Message | Sends a message to a Slack channel. |
| Display Message | Shows a message to the current user. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| From | The sender, as a user ID, username or email, for example [User:UserID] or admin. If it's empty or no user matches, the current user is the sender. | Yes | empty string | No |
| To | The users who receive the message. Enter user IDs, usernames or emails, separated by ; or ,, for example jdoe;42;[ManagerEmail]. Values that don't match a user are skipped. | Yes | empty string | No* |
| To Roles | The roles that receive the message. Pick a role, or switch to an expression and enter role names or IDs separated by ; or ,, for example Approvers;Managers. Only superusers and administrators can send to roles. Roles that don't exist are skipped. | Yes | empty | No* |
| Subject | The message subject, for example New request from [FirstName] [LastName]. | Yes | empty string | No* |
| Body | The message body. It can contain HTML, for example <p>Request [RequestId] needs your review.</p>. | Yes | empty string | No* |
| Attach Portal Files | Portal files to attach, picked from the site's files. | No | empty | No |
| Attach File Field | Forms only. A single or multiple file upload field whose files are attached. | No | empty | No |
| Attach from Token | One file to attach, as a file ID or a path relative to the portal home folder, for example Reports/[ReportName].pdf or [ReportFileId]. | Yes | empty string | No |
* The message needs at least one recipient, from To or To Roles, and a subject or a body. DNN rejects it otherwise.
Output Parameters Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Message Id Token | The token that receives the ID of the sent message, for example MessageId. | No | empty string | No |
Considerations
- Recipients are matched in order. A number is treated as a user ID only. Otherwise the value is tried as a username, then as an email. A username that's all digits can't be used, so use the user's ID or email instead.
- Unknown recipients are skipped silently. If none of the values match, there are no recipients and DNN rejects the message.
- Sending to roles needs permission. Only superusers and administrators can send to roles. The check is done on the sender, so set From to an administrator if the current user isn't one.
- When nobody is logged in, set From. Otherwise the sender is the current user.
- Attachments must be allowed in the site's DNN messaging settings. Files that can't be found are skipped.
- Attach File Field fails with an error if the field has no uploaded file tokens.
- DNN's messaging limits apply, such as the maximum number of recipients and the wait time between messages for users who aren't administrators.
- Email copies are sent by DNN, not by this action. They depend on DNN's messaging settings, each user's notification preferences, and the DNN scheduler.
Examples
To understand how to use the below examples, please see Running Examples.
1. Notify approvers of a new request
This action sends a message to the Approvers role, from the site administrator. The message ID is saved in the MessageId token.
{
"Title": "Send DNN Message",
"ActionType": "SendDnnMessage",
"Description": "Notify approvers",
"Parameters": {
"From": "admin",
"To": "",
"ToRoles": {
"Expression": "Approvers",
"Value": "",
"IsExpression": true,
"Parameters": {}
},
"Subject": "New request from [FirstName] [LastName]",
"Body": "<p>Request <strong>[RequestId]</strong> is waiting for your approval.</p>",
"FileToken": "",
"MessageIDTokenName": "MessageId"
}
}
2. Send a report to one user's inbox
This action sends a message to the user whose email is in the CustomerEmail token, with a PDF from the portal attached. It only runs when the ReportFile token isn't empty.
{
"Title": "Send DNN Message",
"ActionType": "SendDnnMessage",
"Description": "Send monthly report",
"Condition": "[ReportFile] != \"\"",
"Parameters": {
"From": "",
"To": "[CustomerEmail]",
"Subject": "Your monthly report",
"Body": "<p>Hi [CustomerName],</p><p>Your report for [Month] is attached.</p>",
"FileToken": "Reports/[ReportFile]",
"MessageIDTokenName": ""
}
}
Revised 09/27/2026