Skip to content

Alerts

Alerts are customized messages for a task with an alert level, title and message.

The alerts are displayed on the Alerts menu of the BotMaestro portal and they can provide clear and fast information about the status of a task and automation.

Emitting Alerts

An alert can be emitted with one of the following types:

  • INFO: Information alert.
  • WARN: Warning alert.
  • ERROR: Error alert.

Here is how we emit alerts for the task created on the previous step:

maestro.alert(
    task_id=task.id,
    title="Info Alert",
    message="This is an info alert",
    alert_type=AlertType.INFO
)
maestro.alert(task.id, "Info Alert", "This is an info alert", AlertType.INFO);
const alert = await maestro.alert(task.id, "Info Alert", "This is an info alert", "INFO")
const alert: Alert = await maestro.alert(task.id, "Info Alert", "This is an info alert", "INFO")

Messages

By using the BotMaestro SDK, users can send messages to each other or even external email addresses in a very simple way.

The Maestro SDK can send two types of messages:

  • TEXT: Plain text message body.
  • HTML: HTML message body.

Here is how we send messages via the Maestro SDK:

# List of emails, if not using, pass an empty list
emails = ["your_email@your_provider.com"]
# List of usernames, if not using, pass an empty list
users = ["maestro_user1", "maestro_user2"]

subject = "Test Message"
body = "This is the message content."

maestro.message(emails, users, subject, body, MessageType.TEXT)
List<String> emails = new ArrayList<>();
emails.add("your_email@your_provider.com");

String subject = "Test Message";
String body = "This is the message content.";

maestro.message(emails, subject, body, MessageType.TEXT);
const emails = ["your_email@your_provider.com"]
// List of usernames, if not using, pass an empty list
const users = ["maestro_user1", "maestro_user2"]

const subject = "Test Message"
const body = "This is the message content."

await maestro.message(emails, users, subject, body, "TEXT")
const emails: array = ["your_email@your_provider.com"]
// List of usernames, if not using, pass an empty list
const users: array = ["maestro_user1", "maestro_user2"]

const subject: string = "Test Message"
const body: string = "This is the message content."

await maestro.message(emails, users, subject, body, "TEXT")