Skip to main content
Version: 1.28 (Current)

Send DNN Message

Audience: Low-code Engineers

Skill 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​

Action NameDescription
Send EmailSends an email through SMTP.
Send Slack MessageSends a message to a Slack channel.
Display MessageShows a message to the current user.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
FromThe 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.Yesempty stringNo
ToThe 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.Yesempty stringNo*
To RolesThe 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.YesemptyNo*
SubjectThe message subject, for example New request from [FirstName] [LastName].Yesempty stringNo*
BodyThe message body. It can contain HTML, for example <p>Request [RequestId] needs your review.</p>.Yesempty stringNo*
Attach Portal FilesPortal files to attach, picked from the site's files.NoemptyNo
Attach File FieldForms only. A single or multiple file upload field whose files are attached.NoemptyNo
Attach from TokenOne file to attach, as a file ID or a path relative to the portal home folder, for example Reports/[ReportName].pdf or [ReportFileId].Yesempty stringNo

* 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​

ParameterDescriptionSupports TokensDefaultRequired
Message Id TokenThe token that receives the ID of the sent message, for example MessageId.Noempty stringNo

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​

tip

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