Skip to main content

How to Collect Email Data for Reporting

This article outlines the available queries (endpoints) for collecting data on emails and email templates, which can be utilized to build detailed reports.

Product Team avatar
Written by Product Team
Updated this week

1. Query Inbox Emails by Card (Public)

This query allows for the retrieval of emails associated with a specific card.

Purpose: To look up the emails associated with a given card

  • Arguments (Required Information):

    • card_id (ID, required): The ID of the card for which you want to retrieve emails;

    • filter_by_current_user (Boolean, optional): If provided, this filters the emails to show only those related to the current user.

Usage Example:

graphql
query {
inboxEmails(cardId: "your_card_id") {
edges {
node {
id
subject
body
sender
receivedAt
}
}
}
}

Returned Data: The query can return the following information for each email:

  1. id

  2. subject

  3. body

  4. sender

  5. receivedAt

2. Retrieve Sent and Received Email Count (Private)

This query provides the total count of sent and received emails for a specific card.

Purpose: To get the total number of sent and received emails associated with a card.

URL: graphql/core

  • Arguments (Required Information):

    • card_id (ID, required): The ID of the card for which you want to count the emails.

Usage Example:

query GetSentAndReceivedCardEmailsCount($cardId: ID!) {
card(id: $cardId) {
sentAndReceivedCardEmailsCount
}
}

3. Access Email Templates (Private)

This query fetches a list of available email templates, with an option to filter by name.

Purpose: To fetch a list of email templates stored in a repository.

URL: graphql/core

  • Arguments (Required Information):

    • repo_id (ID, required): The ID of the repository from which to fetch the email templates.

    • filter_by_name (String, optional): A string used to filter the templates by name.

      Usage Example:

      query GetParsedEmailTemplate($emailTemplateId: ID!, $cardUuid: ID) {
      parsedEmailTemplate(emailTemplateId: $emailTemplateId, cardUuid: $cardUuid) {
      id
      name
      subject
      body
      fromEmail
      toEmail
      ccEmail
      bccEmail
      hasInsecureContent
      }
      }

    Returned Data: The query can return the following details for each email template:

    1. id

    2. name

    3. subject

    4. body

    5. fromEmail

    6. toEmail

    7. ccEmail

    8. bccEmail

    9. hasInsecureContent

Did this answer your question?