Hello,
we have an group email account to automatic import emails into suitecrm. That works.
Emails with a from-address wich is related to an existing contact are visible in the history of that contact.
Now we need to assign the emails to the user, who is assigned to that contact.
(We want to restrict rights, so users could only see their own objects and we users should see their new emails in the email dashlet and it seems that they are only shown if the email is assign to the user.)
We tried to build a workflow, but this does not work. I think it fails because the incoming email is not related to the contact.
(the appropriate fields in the email are empty - if a fill them manually, our workflow assigns the mail to the user as expected)
So our question is: Is there a way to relate the imported emails automatic to an existing contact (or lead), if there is one with the appropriate email address.
suitecrm Version 7.10.4
greetings
SalchoBob
I guess your Workflow is triggering when the Email record gets saved? Only it must be happening before the auto-import process, so before it is related to the Contact.
Can you try to get your Workflow to fire only when the email is imported? Try to see if any field changes at that time (like “Last synchronized” or “Type”).
Thanks for your reply pgr.
No, I tried the workflow for testing on all records at any time (run once) and used the lead/contact module, because I need access to assigned user of the lead/contact (using the email module I couldn’t find a way to access this field).
See attached screenshots.


And here is a screenshots of an email imported by the group mail account

It is assigned to the administrator, who ownes the group mail account, whichh I want to change, but the “related to” field(s) are empty.
And that seems to be the reason for my workflow not assigning the email. When I fill the “related to” manually, the workflow works and assignes the email to the user who is assigned to the lead/contact.
When I watch the appropriate lead/contact, the email is in it’s history, so there must be some kind of relation.
I hope this helps a little to understand my issue.
I don’t think Workflows for “All records” work the way you’re expecting them to work. It’s not a loop going over every record. That “all” simply means “New records” + “Modified records”.
To Mass assign records, just use the list view in any module, then select “Mass update” from the actions menu, then scroll to the bottom and enter the details. Note that you can use a search before doing the Mass assign, to select which records to change.
it does not seem that the workflow is not running. It just ignores the imported emails until I manually relate them to a contact/lead.
So the problem is, that the imported emails are not related to a contact, even they are visible in the history of that contact.
Mass assignement is no option, because this would mean a manual step for something that should be done automatically.
My suggestion a few posts back was to try the Workflow from the “Emails” module, not the Leads module.
When the email is imported by SuiteCRM, it should change some field (hopefully). If you can catch that, then you should already have what you need (the related contact) at that moment, so you can try the assignment.