Emails Callback (Webhook)

The Emails Callback plugin for Post Affiliate Pro allows you to send information about every outgoing email from your affiliate program to an external system via a webhook (callback URL). This can be useful for tracking, logging, or integrating email activity with external services, CRMs, or custom notification systems.

How It Works

  • Every time the system sends an email (e.g., affiliate notifications, admin alerts), the plugin can send the email’s details to a specified callback URL via a POST request.
  • You can choose whether to only send the webhook (without actually sending the email from Post Affiliate Pro), or to do both (send the email and the webhook).
  • The data sent to your callback URL includes the sender, recipients (To, CC, BCC), subject, body, and reply-to address.

Configuration

  1. Enable the Plugin:
    Go to the Plugins section in your Post Affiliate Pro merchant panel and activate the Emails Callback plugin. 
     
  2. Configure the Callback URL:
    After activation, click the Configure button for the Emails Callback plugin.
     
    • Emails callback URL: Enter the URL where you want to receive the webhook POST requests. This should be an endpoint on your server or third-party system that is set up to process incoming POST data.
    • Status: Choose how the plugin should behave:
      • Callback URL is disabled and sending emails is enabled: Default setting. Emails are sent as usual, no webhook is triggered.
      • Callback URL is enabled and sending emails is enabled: Both the email is sent, and webhook POST is triggered for each email.
      • Callback URL is enabled and sending emails is disabled: No email will be sent from Post Affiliate Pro, but a webhook POST is made for each email event.
  3. Save Settings:
    Click Save after entering your callback URL and selecting the desired status.

Webhook Data Structure

Each time an email event occurs (based on your settings), Post Affiliate Pro will send a POST request to your specified URL with the following parameters:

  • from_email: The sender's email address
  • to_recipients: The main recipient email(s)
  • cc_recipients: Any CC recipients
  • bcc_recipients: Any BCC recipients
  • reply_to: Reply-to address
  • subject: Subject of the email
  • body: The HTML body of the email

Typical Use Cases

  • Integrate with external CRM or helpdesk systems to log or process outgoing email events.
  • Archive or audit all outgoing email content for compliance purposes.
  • Trigger custom workflows in your own systems based on Post Affiliate Pro email activity.
  • Disable email sending but still capture email events for analysis or manual processing.

Important Notes

  • If you select "Callback URL is enabled and sending emails is disabled," no emails will be delivered to recipients. Only the webhook will be triggered.
  • The callback POST request includes all the relevant email data, so ensure your server endpoint is prepared to receive and process this data securely.
  • If the callback URL is empty, no webhook POST will be made.
  • Retries are not attempted for failed webhook requests; only the initial attempt is made for each email event.

Troubleshooting & Logs

  • The plugin logs events and errors (such as a missing callback URL or failed requests) in the system log. Check Tools->Event logs if your webhook is not receiving data as expected.
  • Ensure your callback endpoint is reachable from the Post Affiliate Pro server and is able to process POST requests.

Summary

The Emails Callback (webhook) plugin is a powerful tool for integrating your Post Affiliate Pro email activity with external systems. It offers flexibility whether you want to log, process, or even replace email sending with your own actions.

×