Announcement

Collapse
No announcement yet.

How to add From to emails in History side panel?

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

  • How to add From to emails in History side panel?

    Emails in History side panel lack any sign of their direction. It's unclear is email incoming or outgoing, so it would be nice to have at least From field here.

    I tried to dig that issue, but didn't get anything useful.

    I found client/modules/crm/src/views/record/panels/history.js with
    Code:
    listLayout: {
                'Email': {
                    rows: [
                        [
                            {name: 'ico', view: 'crm:views/fields/ico'},
                            {name: 'name', link: true}
                        ],
                        [
                            {name: 'status'},
                            {name: 'dateSent'},
                            {name: 'hasAttachment', view: 'views/email/fields/has-attachment'}
                        ]
                    ]
                },
            },
    I could remove some field and it removes field from the side panel.
    However, I can't figure how to add From field of e-mail.
    I could add 'parentType' and some other fields, and they displayed in panel.
    Database records have column from_string, but adding 'fromString' does not work.
    Administration - Entity Manager - Field Manager shows 'fromAddress', 'fromEmailAddress', 'fromName' and 'fromString' - none of them works.

    Does anybody have a solution?

  • #2
    Hi Stanson,

    I test these field using PDF Template in the https://demo.espocrm.com and that work. I believe if you use these field, clear cache, rebuild cache, refresh tab/browser page it should work? You could test with another field to see if your modification is working (at all).

    Code:
    1 {{from}}
    
    2 {{fromName}}
    
    3 {{fromAddress}}
    
    4 {{fromEmailAddressId}}
    
    5 {{fromEmailAddressName}}
    
    6 {{fromString}}
    
    7 {{fromEmailAddress.name}}
    Code:
    1 erica@example.espocrm.com
    2
    
    3
    4 5efaba69b94646f22
    5 erica@example.espocrm.com
    6
    
    7 erica@example.espocrm.com
    So 1, 5 or field name 7 should work?

    Comment


    • Stanson
      Stanson commented
      Editing a comment
      I rebuild all with php rebuild.php - it clears Espo cache and rebuild Espo JS with my changes.
      Also I Ctrl+Shift+R in browser, to reload rebuilt JS.

      None of that names work in Side panel.

  • #3
    Then I would have no idea. It not something you can reproduce on the demo server to test if it a bug or not.

    You already manage to get other field to be display so it not an issue of you "don't know what to do".

    Could there be some other hidden issue such as field type restriction, or character length, or exceed the numbers of field can be shown at one time.

    Comment


    • #4
      Hi Stanson,

      I decide I too also want to have a "from email" detail in my sidebar and been exploring this possibility as well. After trying for a while it obvious that no variation of these "from email" field will work. And keep trying various combination probably will bring no good result.

      As a rule of thumb I always do a "test" field as well, in this case I did a "isRead", which failed! It should have show to be "True" for most of my test email but all box is blank. I thought maybe it just look like that for "isRead" and it will look differently if it "isNotRead", tried that too but all the same. I also notice the "hasAttachement" and "/view/attachment" and try that to test.

      Then I thought, maybe it got to do with API. Sure enough it seem to be part of an API call system. If we can find this file, modified it so it call "from" email, then we our History field should work.

      I use F12 console > Network to gather these information. Here is the result of response of EspoCRM when it look at Email.

      Code:
      "list": [
      {
      "id": "1111111111",
      "name": "Invitation to meeting 'Test meeting name'",
      "dateStart": "2020-04-21 07:44:17",
      "dateEnd": "",
      "dateStartDate": "",
      "dateEndDate": "",
      "_scope": "Email",
      "assignedUserId": null,
      "assignedUserName": null,
      "parentType": "Contact",
      "parentId": "123123123",
      "status": "Archived",
      "createdAt": "2020-04-23 05:29:14",
      "hasAttachment": true,
      "dateSent": "2020-04-21 07:44:17"
      },
      With this being the URL:

      /api/v1/Activities/Contact/123123123/history?maxSize=17&offset=0&orderBy=dateStart&orde r=desc

      As you can see, it only pull these information, I bet you if we use any of these field above, then it will show no problem!

      Next I will explore this API file, and see if I can bring some good news for us.

      Comment


      • espcrm
        espcrm commented
        Editing a comment
        After digging around I was unable to find where is the API file, can't find any "activities" file either.

        API Folder is quite generic file without any indicate. Anyway hopefully these new information may prove useful to you.
    Working...
    X