ur/uniform-resource-imap-mail-detail.sql

              SELECT 'dynamic' AS component, sqlpage.run_sql('shell/shell.sql') AS properties;
              -- not including breadcrumbs from sqlpage_aide_navigation
              -- not including page title from sqlpage_aide_navigation

              SELECT
'breadcrumb' AS component;
SELECT
'Home' AS title,
  sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/'AS link;
SELECT
 'Uniform Resource' AS title,
  sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/ur/index.sql' AS link;
SELECT
  'Uniform Resources (IMAP)' AS title,
  sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/ur/uniform-resource-imap-account.sql' AS link;
SELECT
'Folder' AS title,
  sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/ur/uniform-resource-imap-folder.sql?imap_account_id=' || ur_ingest_session_imap_account_id AS link
  FROM uniform_resource_imap
  WHERE uniform_resource_id = $resource_id::TEXT GROUP BY ur_ingest_session_imap_acct_folder_id;

SELECT
   folder_name AS title,
  sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/ur/uniform-resource-imap-mail-list.sql?folder_id=' || ur_ingest_session_imap_acct_folder_id AS link
  FROM uniform_resource_imap
  WHERE uniform_resource_id=$resource_id::TEXT GROUP BY ur_ingest_session_imap_acct_folder_id;

SELECT
   subject AS title,
  sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/ur/uniform-resource-imap-mail-detail.sql?resource_id=' || uniform_resource_id AS link
  FROM uniform_resource_imap
  WHERE uniform_resource_id = $resource_id:: TEXT;

--Breadcrumb ends-- -

  --- back button-- -
    select 'button' as component;
select
"<< Back" as title,
  sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/ur/uniform-resource-imap-mail-list.sql?folder_id=' || ur_ingest_session_imap_acct_folder_id as link
  FROM uniform_resource_imap
  WHERE uniform_resource_id = $resource_id:: TEXT;

--Display uniform_resource table with pagination
  SELECT
'datagrid' as component;
SELECT
'From' as title,
  "from" as "description" FROM uniform_resource_imap where uniform_resource_id=$resource_id::TEXT;
SELECT
'To' as title,
  email as "description" FROM uniform_resource_imap where uniform_resource_id=$resource_id::TEXT;
SELECT
'Subject' as title,
  subject as "description" FROM uniform_resource_imap where uniform_resource_id=$resource_id::TEXT;

  SELECT 'html' AS component;
  SELECT html_content AS html FROM uniform_resource_imap_content WHERE uniform_resource_id=$resource_id::TEXT ;