API reference: Transactional messages documents the function signatures, parameters, return values, and error behavior of the Elaine HTTP API.
Note
Function availability depends on the Elaine release and enabled features. Authenticate HTTP requests with an Elaine-issued Bearer JWT.
Function overview
| array|integer | api_getTransactionMailStatus ( int $id = null , bool $is_msgid = false ) |
| Returns the status of a transactional email via mailing queue ID $id. | |
| integer|boolean | api_sendSingleTransaction ( array $data = null , int $nl_id , int $ev_id , int $variant_position = null , boolean|integer $blacklist = true ) |
| Properties of the $data-Arrays:arraycontent: Content of the transactional message: string c_email: Recipient of the transactional message. |
Functions
api_getTransactionMailStatus
array|integer api_getTransactionMailStatus ( int $id = null , bool $is_msgid = false )
Returns the status of a transactional email via mailing queue ID $id. If $is_msgid=true, the $id has to be the external message ID that was defined when the message was sent.
The return array contains the following values:
- string
'status':'queued': Message is in the queue and is being sent'sent': Message has been sent'bounced': Message has bounced'c_email_is_null': The recipient address is empty or has an invalid format'invalid_from_address': The sender address is empty or has an invalid format'mailer_error': Error during dispatch'content_empty': The content of the dispatched message is empty- or any project-specific error messages
- string
'date': Time of the last status change as string - int
'p_id': Profile ID of recipient - int
'msgid': External message ID (if available) - bool
'notified': Indicates whether the notification URL was called (only included if a notification URL was specified during dispatch)
Parameters
| int | $id = null | mailing queue ID |
| bool | $is_msgid = false | true if $id is an external message ID |
Return Value
| array|integer | status data (see description) |
api_sendSingleTransaction
integer|boolean api_sendSingleTransaction ( array $data = null , int $nl_id , int $ev_id , int $variant_position = null , boolean|integer $blacklist = true )
Properties of the $data-Arrays:
- array
content: Content of the transactional message:- string
c_email: Recipient of the transactional message. Another data field can optionally be used to identify a recipient. This must be configured separately by ELAINE technologies. - array
t_attachment: (optional) The attachments of the message. An array of file name (key) and base64 encoded content of the file (value). This allows you to add multiple attachments to a transactional message. - string|array
t_cc: (optional) CC recipient, single address or array with multiple addresses. - string
t_[free text]: (optional) Any additional data fields that are included in the Transactional Message as T-datafields.
- string
- int
priority: (optional) 1-100, priority value for dispatch. The default priority value is 99 which is nearly the most important priority value for preferred delivery. Only Emergency with value 100 has higher priority. Therefore, transaction messages can be processed with higher priority over normal list dispatches or automation messages. - bool
override: (optional) if true, transactional data overrides existing profile data (c-, e- and s- datafields), if false, existing profile data has precedence for message individualization - bool
update_profile: (optional) Update existing profile data with transactional data (persist c- and e- datafields from the call) - string
msgid: (optional) External Message ID as additional key for status requests or notifications - string
notify_url: (optional) URL to notify in case the transactional message bounces. The URL can also contain ELAINE placeholders.
Behavior in bulk mode: Contrary to usage via single calls, the bulk call considers the Bounce List and marks corresponding recipient data records. In addition, the bulk parameter $abort_on_error is not used for this function. The transmitted block is either processed entirely or discarded. The bundled transmitted single calls must reference the same $nl_id.
Parameters
| array | $data = null | Content and control parameters |
| int | $nl_id | Mailing ID |
| int | $ev_id | Recipient group id for group context (optional) |
| int | $variant_position = null | Variant position for multi variant mailings (optional) |
| boolean|integer | $blacklist = true | Boolean true for elaine blacklist, boolean false for no blacklist, integer ev_id for own blacklist (optional) |
Return Value
| integer|boolean | Mailing queue ID on success, negative error code or boolean false |