email_in 기능을 사용할 때는 어떤 이메일이 설정되어 있으며, 어떤 카테고리나 그룹과 연결되어 있는지 추적해야 합니다. 이 data-explorer 쿼리는 카테고리 슬러그 또는 그룹 이름과 연결된 이메일 주소를 목록으로 표시하여, 해당 목록을 게시물에 복사하여 붙여넣을 수 있습니다. 이를 통해 클릭 가능한 목록을 만들어 설명에 올바른 이메일 주소가 언급되었는지 확인하거나, 메일 전송 에이전트(MTA) 설정을 검증하는 데 사용할 수 있습니다.
Import와 함께 사용: configured-email-addresses.dcquery.json (1.2 KB)
-- Return all configured emails for categories and groups, ordered by name
--
-- Build category slugs
WITH cat_slug AS (
-- Capture category slug to make it clickable in a post
SELECT CONCAT('#', c.slug) AS identifier, c.id
FROM categories c
WHERE c.parent_category_id IS NULL
GROUP BY identifier, c.id
UNION ALL
-- Do this for subcategories as well
SELECT CONCAT('#', p.slug, ':', c.slug) AS identifier, c.id
FROM categories c, categories p
WHERE c.parent_category_id = p.id
GROUP BY identifier, c.id
ORDER BY identifier
)
-- Capture @group, email pairs
SELECT CONCAT('@', g.name) AS name, g.incoming_email AS email
FROM groups g
WHERE g.incoming_email IS NOT NULL
GROUP BY name, email
UNION ALL
-- Capture #category, email pairs
SELECT cs.identifier AS name, c.email_in AS email
FROM categories c, cat_slug cs
WHERE c.id = cs.id AND c.email_in IS NOT NULL
GROUP by cs.identifier, name, email
-- Provide a nice alphabetically ordered list
ORDER BY name