Writing a Sugar report on email module.

Is there any field for the body of the email?

Parents
  • Kelly,

    If you have SugarCRM Enterprise or Ultimate editions and are familiar with writing SQL queries, you can create a query that joins the email body into the report.  

    For example, create a standard email type report from the Reports module, when editing the report, in the "Report Details" section check the "Show Query" checkbox and click "Preview". 

    This will display the SQL query of the report at the bottom of the page.

    You can then customize this query to add a join statement to the email_text table that contains the body of the email.

    Click here more information on the database tables and fields.

    Click here for information on Advanced Reporting.

    Here is a basic example of a query that pulls in the email subject, description, and date created data:

    SELECT IFNULL(emails.name,'') emails_name
    ,emails_text.description
    ,emails.date_entered emails_date_entered
    FROM emails
    LEFT join emails_text
    ON emails.id = emails_text.email_id

    WHERE ((1=1))
    AND emails.deleted=0

    Hope this helps.

    Lori

Reply
  • Kelly,

    If you have SugarCRM Enterprise or Ultimate editions and are familiar with writing SQL queries, you can create a query that joins the email body into the report.  

    For example, create a standard email type report from the Reports module, when editing the report, in the "Report Details" section check the "Show Query" checkbox and click "Preview". 

    This will display the SQL query of the report at the bottom of the page.

    You can then customize this query to add a join statement to the email_text table that contains the body of the email.

    Click here more information on the database tables and fields.

    Click here for information on Advanced Reporting.

    Here is a basic example of a query that pulls in the email subject, description, and date created data:

    SELECT IFNULL(emails.name,'') emails_name
    ,emails_text.description
    ,emails.date_entered emails_date_entered
    FROM emails
    LEFT join emails_text
    ON emails.id = emails_text.email_id

    WHERE ((1=1))
    AND emails.deleted=0

    Hope this helps.

    Lori

Children