Function Reference
All functions live in the pgrelay_notifier schema. This page covers the sender-facing API — profile management, channel creation, and grants are DBA tasks; see the DBA Guide's own reference.
Sending
| Function |
Returns |
What it does |
compose(p_profile, p_to, p_subject, p_body_text, p_body_html, p_cc, p_bcc, p_reply_to, p_sender, p_priority, p_debug) |
bigint |
Creates a draft notification (not yet queued). p_profile NULL/'' falls back to the default-profile option. Returns the notification_id. |
send(p_profile, p_to, p_subject, p_body_text, p_body_html, p_cc, p_bcc, p_reply_to, p_sender, p_priority, p_debug, p_run_at, p_expire_at, p_channel, p_deduplicate) |
bigint |
compose() + dispatch() in one call — the everyday path for messages without attachments. |
Attachments
| Function |
Returns |
What it does |
attach(p_notification_id, p_filename, p_content bytea, p_content_type, p_inline) |
bigint |
Adds a binary attachment to a draft. Draft-only — attachments freeze at dispatch. Enforces the profile's max_attach_mb/max_attach_number. |
attach_text(p_notification_id, p_filename, p_content text, p_content_type, p_inline) |
bigint |
Text convenience over attach() — content stored as UTF-8. |
dispatch(p_notification_id, p_run_at, p_expire_at, p_channel, p_deduplicate) |
void |
Enqueues a draft (payload = the notification id). Commits with the caller's transaction. |
Oracle UTL_MAIL-style
See The Oracle UTL_MAIL-Style Calls for the full behaviour.
| Function |
Returns |
What it does |
send_mail(p_profile, p_recipients, p_subject, p_message, p_mime_type, p_cc, p_bcc, p_sender, p_reply_to, p_priority) |
bigint |
UTL_MAIL.SEND analogue. |
send_mail_attach_raw(p_profile, p_recipients, p_subject, p_message, p_attachment bytea, p_att_inline, p_att_mime_type, p_att_filename, p_mime_type, p_cc, p_bcc, p_sender, p_reply_to, p_priority) |
bigint |
UTL_MAIL.SEND_ATTACH_RAW analogue. |
send_mail_attach_text(p_profile, p_recipients, p_subject, p_message, p_attachment text, p_att_inline, p_att_mime_type, p_att_filename, p_mime_type, p_cc, p_bcc, p_sender, p_reply_to, p_priority) |
bigint |
UTL_MAIL.SEND_ATTACH_VARCHAR2 analogue. |
Status and observability
| Function |
Returns |
What it does |
get_status(p_notification_id) |
table |
Current state, recipients, subject, status_detail, provider_ref, attempt count, elapsed time. |
list_notifications(p_status, p_since, p_limit) |
table |
Filtered, paginated listing across many notifications. |
get_history(p_notification_id) |
table |
Every recorded attempt for one notification, oldest first. |
get_trace(p_notification_id) |
table |
The step-by-step debug trace, when p_debug/profile debug was on. |