Announcement

Collapse
No announcement yet.

E-mail to case mapping and processing

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

  • E-mail to case mapping and processing

    I have the "email to case" feature turned on. Mostly all my e-mails come from a webform at my website, so all of them have the same "from" address that is not the real "sender" e-mail. Their e-mails are on the "replyTo" field. Is there a way to assign the correct e-mail to the case using the EspoCRM interface? If not, where is the best way to do it? I found some of the email to case code at "application\Espo\Services\InbounbEmail.php", but maybe there is a more elegant and correct way to map the fields.

    I also would like to process some fields, as the default case description copies the full e-mail body, with a lot of css. What's the best way to do it? I read about writing a hook. I did a "beforeSave" at "application\Espo\Modules\Crm\Hooks\Case\myHook.ph p" (and cleared the cache), but it didn't fire. Any hints?

    Thanks in advance!

  • #2
    In the v7.1 upcoming release the inbound email code was completely refactored. There will be the ability to bind a custom fetcher factory the way it's done here. In the factory, you will be able to pass a custom hook AfterFetch like here. See the developer documentation > dependency injection about binding.

    A case body is written with the body-plain of the email. There should not be any css. Maybe your emails are composed wrong.
    Last edited by yuri; 04-15-2022, 06:54 AM.

    Comment


    • #3
      You can also utilize the workflow tool from the advanced pack. Create a workflow that triggers when a case entity is created, with the condition Group Email Account = (select your group email account). This workflow will be triggered only for cases created through the email-to-case way. Using formula you can get reply-to email address from the email, use this address to find an associated record and relate that record to the case.

      Another option. If you have a record in the CRM associated with the "from" address your emails are sent from, try to erase that address from the record. If no record is found by 'from', the 'reply-to' is used. See https://github.com/espocrm/espocrm/b...orter.php#L334

      Comment


      • #4
        Thank you Yuri, but I don't have the advanced pack. I figured out I could do mostly of what I wanted using "Before Save Custom Script" formulas at the Email Entity.

        Comment

        Working...
        X