Webhook: e-mailgebeurtenissen afhandelen

Introduction

Inboxroad webhooks bieden realtime meldingen, zodat er snel gereageerd kan worden op e-mailgebeurtenissen zoals afleveringen, bounces of klachten. Deze webhooks bieden waardevolle inzichten in e-mail deliverability, waardoor verfijnde e-mailcampagnestrategieën mogelijk worden. Geautomatiseerd lijstbeheer via webhooks helpt bij het bijhouden van schone e-maillijsten, waardoor de kosten dalen en de betrokkenheid van gebruikers toeneemt. Real-time gegevens van webhooks zijn ook in lijn met best practices voor e-mail, waardoor de reputatie van de afzender behouden blijft.

1. Overview of Email Events

Inboxroad vergemakkelijkt het volgen van:

  • Bounces (“b”) & (“rb”): Emails that are not delivered, differentiated as HARD and SOFT based on the underlying reason.
  • Delivered (“d”): Emails that reach the recipient’s inbox successfully.
  • Complaints (“f”): Emails reported as spam or considered unwanted.

2. Setting up the Webhook for Email Events

  • Setup an endpoint on your end to receive webhook events.
  • Reach out to contact@inboxroad.com, mention your endpoint and we’ll handle the rest.

3. Email Event Payload Structure and Sample

Wanneer een e-mailgebeurtenis plaatsvindt, stuurt Inboxroad een HTTP POST-verzoek met gedetailleerde payloadinformatie. Hier is een overzicht:

  • type: Represents the event type (“b” for bounced, “rb” for remote bounced, “d” for delivered, “f” for complaints).
  • timeLogged: Timestamp marking when the event was logged.
  • orig: Sender’s email address.
  • rcpt: Recipient’s email address.
  • dsnAction: Delivery status notification action.
  • dsnStatus: Delivery status notification’s status.
  • dsnDiag: Diagnostic information from the SMTP.
  • bounceCat: The category of the bounce.
  • rcvSmtpUser: The SMTP user who received the email.
  • header_Message-Id: A unique identifier for the email.
  • vmta: The Virtual Mail Transfer Agent used.

 

De payload moet het volgende formaat hebben:


json

{
    "type": "d",
    "timeLogged": "1695222842",
    "orig": "adress@rp.domain.com",
    "rcpt": "example@domain.net",
    "dsnAction": "relayed",
    "dsnStatus": "2.0.0 (success)",
    "dsnDiag": "smtp;250 2.0.0 OK",
    "bounceCat": "other",
    "rcvSmtpUser": "user",
    "header_Message-Id": "<80894b937274b975f9e3ab05f0a009636d2016d9@rp.domain.com>",
    "vmta": "a000"
}

4. Bounce Classification with BOUNCE_MAPPER

Inboxroad provides a granular bounce classification system to enable precise actions based on the bounce’s nature. This is categorized using the bounceCat field in the payload, as:


python

BOUNCE_MAPPER = {
    'message-expired': 'EXPIRED',
    'bad-mailbox': 'HARD',
    'bad-domain': 'HARD',
    'quota-issues': 'SOFT',
    'inactive-mailbox': 'SOFT',
    'no-answer-from-host': 'SOFT',
    'relaying-issues': 'SOFT',
    'routing-errors': 'SOFT'
}

Leverage this mapper to ascertain the nature of each bounce (e.g., HARD, SOFT, EXPIRED).

5. Handling Email Events

For Bounces (“b”) & (“rb)”: Use the BOUNCE_MAPPER to classify and act. For example:

  • HARD bounces typically highlight persistent issues. These should not be targetted in your next campaign(s).
  • SOFT bounces might be transient, necessitating careful observation before action. Monitor the soft bounces and exclude them from your list after 5 occurrences.

For Delivered (“d”): Analyze, log, and respond as suitable for your application.

For Complaints (“f”): Don’t target these anymore since they’ve complained on one of your campaigns.

Neem contact met ons op als je hulp nodig hebt

Neem contact op met ons ondersteuningsteam als je hulp nodig hebt.