Announcement

Collapse
No announcement yet.

Mark an Email as Read, Setting the FolderID and determine the active user

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mark an Email as Read, Setting the FolderID and determine the active user

    Greetings,

    We recently aquired the advanced pack in order to implement Workflows and Reports on your CRM. We've been able to do most of the things but, right now, there are three things which cannot be worked out:
    • We cannot mark an Email as read. The Rule on the Workflow extension works flawless to create a Task using the Email input, but cannot mark it as read. We're using the isRead property of the target entity and setting it to true, but isn't working. If I'm rtight, the mails are marked as read depending on the user (Table email_user).
    • We cannot set an certain folderId for the targetEntity, meaning that all Emails are kept at the inbox folder. We're trying to force the Email to be sent to a certain user folder, in order to hide it from all the user inboxes.
    • We cannot tell which user received the Email. We want to set the task to the user with the Email account configured. But when checking the assigned user of the target entity, it's null. Right now, we check if the Email has a parent account and use its Account assigned user instead.
    The action on the Workflow rule looks like this:
    Click image for larger version

Name:	rule_action.png
Views:	115
Size:	6.5 KB
ID:	29633
    But this doesn't update the is_read column on the email_user table, neither the folder_id.

    My question is: is there any way to update those fields in the Workflow module? Even if using Espo-Formula?

    Thanks in advanced!

  • #2
    Hello
    • We cannot mark an Email as read. The Rule on the Workflow extension works flawless to create a Task using the Email input, but cannot mark it as read. We're using the isRead property of the target entity and setting it to true, but isn't working. If I'm rtight, the mails are marked as read depending on the user (Table email_user).
    According to application/Espo/Services/Email.php markAsRead method, this value is set into database table. You can call this method in own action method
    https://www.espocrm.com/features/add...-for-workflow/
    • We cannot set an certain folderId for the targetEntity, meaning that all Emails are kept at the inbox folder. We're trying to force the Email to be sent to a certain user folder, in order to hide it from all the user inboxes.
    Did you try to set filters? https://github.com/espocrm/documenta...#email-filters
    • We cannot tell which user received the Email. We want to set the task to the user with the Email account configured. But when checking the assigned user of the target entity, it's null. Right now, we check if the Email has a parent account and use its Account assigned user instead.
    You can create case, when email fetching. And you can create related tasks for cases with workflow

    Thanks


    Comment


    • #3
      Thanks Tanya,

      According to application/Espo/Services/Email.php markAsRead method, this value is set into database table. You can call this method in own action method
      https://www.espocrm.com/features/add...-for-workflow/

      I'll try calling that method and I'll comment here if it works, but I kind of feel it won't, since I cannot tell (As far as I know) to which user is the Email Account linked to and the method uses $this->getUser()->id;, which seems to get the active user when it isn't specified.


      Did you try to set filters? https://github.com/espocrm/documenta...#email-filters
      We tried it, but the filters work on the Email content (Subject, from, to, parent, body content), since those are applied when fetching them. We're trying to move them depending on the Email Parent (If the Email has a parent, change its folder), but that option doesn't exist on filters, hence the need to do this on the Workflow module.


      You can create case, when email fetching. And you can create related tasks for cases with workflow
      That would be a good option, but we're using personal email accounts, not group email accounts, and those don't have that option.

      I'll try to explain what we're trying to do: we want every user to have configured their Emails as personal Emails (Not making every mail globally avaliable) and, when an Email arrives, a rule in the Workflow module will check if it has an account/parent assigned. If that's the case, it will create a task which should be assigned to the user who received the Email (Not the Account assigned user, which is what we're doing right now), mark the email as read and move it to a different folder (Especially to make it dissapear from the Dashboard Email Widget).
      We know we can do this customizing through Extensions (Especially using action methods), but we want first to workout our needs without coding, leaving it as a last resort.

      Thanks.

      Comment

      Working...
      X