Get Cisco Webex Teams space messages and email them

  1. Add and configure Cisco Webex Teams ‘Get Space Messages’ action

    This flow fetches all the messages of a particular space in Cisco Webex Teams, and sends them to the recipient’s email address.

    To set up this flow, you will need to use three activities: Cisco Webex Teams ‘Get Space Messages’, JSON to HTML, and Send an Email.

    The first step is to add Cisco Webex Teams ‘Get Space Messages’ action to your canvas. This action retrieves the list of all the messages of a particular space. To implement this, configure the action by clicking the ‘settings’ icon that appear when you hover on the action icon.

    On the configuration page, you will see a number of fields. Enter value in these fields as per the instructions given below:

    Field name Description (Input)
    Action Label Specify a custom name, if required. Default is ‘Get Space Messages’.
    Authorize Cisco Webex Teams  Select the appropriate access token for Cisco Webex Teams. If you haven’t created an authorization, select Add New to create one.
    Space ID Select the ID of the space (from the dropdown options) whose messages you wish to fetch. You can optionally enter the Space ID manually.
    Fetch Messages before Date (Optional) Specify a date if you wish to get messages posted before that date.
    Fetch Messages before Message (Optional) Specify a message ID if you wish to get messages sent before that message.
    Number of Messages to be included (Optional) Enter the maximum number of items you wish to get in the response


    Below is the image for configuring Get Space Messages of Cisco Webex Teams action:

    1.PNG


    Once you enter required values in the fields, Click the 'NEXT' button, text the action, and click Done to return to workflow canvas.

    Since the output of ‘Get Space Messages’ action contain raw JSON data, it is recommended that you use ‘JSON to HTML’ action to convert JSON into HTML before sending it via email. This will improve the readability of the output.

  2. Add and configure ‘JSON to HTML’ action

    This action converts any JSON data into HTML format. To implement this, add this action to your canvas, and connect it with ‘Get Space Messages’ action. Configure ‘JSON to HTML’ action, and enter values in the fields as per the instructions given below:

    Actions Description (Input)
    Action label Specify a custom name, if required. Default is ‘JSON to HTML’.
    JSON Data Use the output of Get Space Messages action as the input value for this field (e.g. {{$a0}}).
    Jade template (Optional) Provide Jade template, if required.


    Below is the image for configuring JSON to HTML action:

    2.PNG

    Once you enter the required details, click NEXT, test the action, and click on 'DONE' to return to workflow canvas.

  3. Add and configure ‘Send an Email’ action

    The ‘Send an Email’ action sends an email to the specified email address. Let’s add this to our canvas, connect it with ‘JSON to HTML’ action, and configure it. Enter values in the available fields as per the instructions given below:

    Actions Description (Input)
    Action label Specify a custom name, if required. Default is ‘Send an Email’.
    To Enter email address of the recipient.
    Cc (Optional) Enter email address of the recipients you wish to mark the copy to.
    Bcc (Optional) Enter email address of the recipients you wish to mark a blind copy to.
    Reply To (Optional) Again, this field is optional. If you want to use the reply to field then, you need to enter details in this field
    Subject Enter a suitable subject for the email
    Body Type (Optional) Select body type. Available options are Text or HTML.
    Body Use the output of the JSON to HTML action as the input value for this field (e.g., {{$a1}}).


    Below is the image for configuring Send an Email action:

    3.png

    Once you enter the required details, click NEXT, test the action, and click on 'DONE' to return to workflow canvas.

  4. Save and test the workflow

    Now that all the actions have been configured, ‘Save’ your workflow. Click ‘Test’ to manually execute the workflow.

    As soon as the workflow starts its execution, you will see real-time indicators showing the progress of the workflow. Once the execution is completed, you will receive an email that contains all the messages of the specified Cisco Webex Teams space in HTML format.

    image-output