Use the Mailer tool to send emails to users inside your Rocket.Chat server. The Mailer handles outgoing emails from Rocket.Chat, such as notifications, password resets, account verification, and general transactional emails. It’s essentially your standard SMTP setup that allows the platform to send emails through an external SMTP provider (like SendGrid, Mailgun, Gmail, or your organization's own SMTP server).
Before using this feature, make sure that you have configured the workspace’s SMTP configuration.
To access this menu, navigate to Administration > Workspace > Mailer.
Use the
From
field to set the address to send the email.Check the Dry Run option to send the email only to the address defined in
From
.You can also filter who receives the email by using a valid user query in the
Query
field, otherwise, all workspace users will receive this email. Unsubscribed users are automatically removed from the query. It must be a valid JSON. For example:"{"createdAt":{"$gt":{"$date": "2015-01-01T00:00:00.000Z"}}}"
Then, you can write a subject and a body for the email. When you write the body, add brackets to add dynamic data to the body. This field accepts HTML tags.
Add the following brackets to the email body:
[unsubscribe]
: creates an unsubscribe link. The email body must have an unsubscribe link.[name]
: uses the full name of the user that receives the email.[fname]
: uses the first name of the user that receives the email.[lname]
: uses the last name of the user that receives the email.[email]
: uses the email address of the user that receives the email.
Click Send email.
The following is a basic example of the email body:
Dear [name], [email]
hello world! :)
<p><a href="[Site_URL]">[unsubscribe]</a></p>
The email that users receive looks like this: