Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18326

google-mail-stream - message body as raw

    XMLWordPrintableJSON

Details

    • Moderate

    Description

      Hello,

       

      In google-mail-stream component, the mail body is displayed as plain text and is not easy to manipulate the data.

      The component should add the possibility to change this behavior and displayed a standardize object (JSON or other).

       

      // code placeholder
      from('google-mail-stream:index?' +
        'applicationName={{camel-app-name}}&' +
        'accessToken={{gmail.client.access.token}}&' +
        'refreshToken={{gmail.client.access.refresh.token}}&' +
        'clientId={{gmail.client.id}}&' +
        'query=is:unread&' +
        'clientSecret={{gmail.client.secret}}')
        .log('body: ${body}') 

       

      Here is the format received by google-mail component for example:

       

      // code placeholder
      {
        "historyId": "",
        "id": "",
        "internalDate": "",
        "labelIds": [  ],
        "payload": {
          "body": {
            "size": 0
          },
          "filename": "",
          "headers": [
            {
              "name": "",
              "value": ""
            }
          ],
          "mimeType": "",
          "partId": "",
          "parts": [
            {
              "body": {
                "data": "",
                "size": 241
              },
              "filename": "",
              "headers": [
                {
                  "name": "",
                  "value": ""
                }
              ],
              "mimeType": "",
              "partId": ""
            },
            {
              "body": {
                "data": "",
                "size": 2519
              },
              "filename": "",
              "headers": [
                {
                  "name": "",
                  "value": ""
                }
              ],
              "mimeType": "",
              "partId": ""
            }
          ]
        },
        "sizeEstimate": 3513,
        "snippet": "",
        "threadId": ""
      }
       

       

      What do you think?

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              Sybernatus Jérôme GARCIA
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: