Roboteka
Roboteka · Robots · Get last e-mail

Get last e-mail

The Get last e-mail robot pulls the latest incoming e-mail of a lead, deal, contact or company into a Bitrix24 (Alaio) workflow: subject, text without HTML, sender address and name, date and attachment Drive file IDs.

The robot reads the timeline of a CRM item and returns the latest e-mail so the next workflow step can use it. Stock robots cannot see e-mail content: you cannot check the subject, copy the text into a field or forward the attachments. The robot finds the most recent e-mail in the chosen direction (incoming by default, outgoing or any as options) and returns its subject, the text in two forms (plain text without markup and the original HTML), sender address and name, date, activity ID and the Drive file IDs of the attachments, which the file robots accept. By default the item the process runs on is used, smart process elements included; any lead, deal, contact or company can be given by ID. When there are no e-mails the robot returns "E-mail found = No" and the process can take another branch.

What input parameters does the robot accept?

Parameter Type Required? Default
Item select Current item, Lead by ID, Deal by ID, Contact by ID, Company by ID — current
Item ID (for the "by ID" modes) string —
Which e-mail to look for select Incoming, Outgoing, Any — incoming

What does the robot return?

Parameter Type
E-mail found bool
Subject string
E-mail text (no HTML) text
E-mail text (HTML) text
Sender e-mail string
Sender name string
E-mail date string
Direction (incoming / outgoing) string
Activity ID int
Attachment Drive file IDs int
Number of attachments int
Success bool
Error string

What errors can the robot return?

The robot writes these messages to the business process log when it cannot complete a step. The text tells you what to fix in the settings or the data.

  • Could not resolve the item. In a "by ID" mode enter a valid ID; the current item must be a lead, deal, contact, company or smart process element.
  • API error while reading the item e-mails.

Scenario: route a client reply by its subject

  1. The robot is placed on the "Waiting for reply" stage and runs on an incoming e-mail
  2. It returns the subject and text of the latest incoming e-mail of the deal
  3. A condition checks whether the subject contains "invoice" and hands the deal to accounting together with the attachments

Related robots