Configure e-mail notifications via mailto hooks: parameters, templates and versions.
In addition to webhooks, the PSB can send notifications by e-mail. An e-mail hook (also known as a mail hook or mailto hook) sends an e-mail for every event on a chosen topic. This is useful for organisations that do not have their own webhook endpoint, or as a supplement to existing webhooks.
Register a hook via the API with a mailto: action:
{
"action": "mailto:[email protected]",
"topics": ["InvoiceReceived"]
}
For every received invoice the PSB now sends a notification e-mail to the specified address. The e-mail address in the action may also contain a placeholder: [senderEmailAddress] or [receiverEmailAddress] to dynamically send to the sender's or recipient's e-mail address.
Note: when using placeholders, always include the
fallbackEmailparameter. If the e-mail address is not available in the document, the PSB sends the notification to the fallback address.
E-mail hooks support extensive configuration via query parameters in the action URL. You build the URL as mailto:[email protected]?param1=value¶m2=value.
includeAttachmenttrue / falsetargetDocumentTypeIdfilename{{id}}{{extension}}. URL-encode this valueexcludePrimaryAttachmenttrue / falseexcludeAdditionalAttachmentstrue / falseversion0.9 or 1.0templateIdfallbackEmailreplyTobccfromThe PSB supports two versions of the e-mail template:
0.9[email protected]1.0[email protected]Tip: always use version
1.0for new configurations. Version0.9sends from the old eVerbinding domain, which is no longer actively maintained.
An e-mail hook that sends an e-mail with the invoice as a PDF attachment (without the XML) for every received invoice:
mailto:[email protected]?includeAttachment=true&excludePrimaryAttachment=true&version=1.0
A hook that dynamically sends to the sender, with a fallback:
mailto:[senderEmailAddress]?includeAttachment=true&version=1.0&[email protected]
Want full control over the e-mail layout? Have eConnect configure a custom SendGrid template and use the templateId parameter. You can also link your own SendGrid account by adding an init object with your API key to the hook configuration.
You can specify multiple e-mail addresses by creating separate hooks, or by using the bcc parameter for additional recipients.
Placeholders such as [senderEmailAddress] or [receiverEmailAddress] are only resolved when that address appears in the document. If it is missing, the PSB sends the notification to the address in fallbackEmail, so you do not lose the message.
Version 0.9 uses the older sender domain [email protected]; version 1.0 uses [email protected] with modern layout. For new configurations, 1.0 is the recommended choice.
Set includeAttachment to true and excludePrimaryAttachment to true, so you only send a PDF attachment, for example. Combine this with version=1.0 in the query string for the desired template.
See the full API specification at psb.econnect.eu for all available configurations and examples.
Open the API reference