Rebound API Docs

Brought to you by Postmark

Example Javascript Snippet


<script>
  window.ReboundSettings = {
    publicToken: "public_token",
    email: "user_email"
  }
</script>
<script>(function(r,e,b,o,u,n,d){if(r.Rebound)return;d=function(){o="script";u=e.createElement(o);u.type="text/javascript";u.src=b;u.async=true;n=e.getElementsByTagName(o)[0];n.parentNode.insertBefore(u,n)};if(r.attachEvent){r.attachEvent("onload",d)}else{r.addEventListener("load",d,false)}})(window,document,"https://rebound.postmarkapp.com/widget/1.0");</script>

Set up Rebound

window.ReboundSettings required

Name Description
publicToken required Used to authenticate your script.
email required Your logged-in user’s email address.
appearance The alert message style. Possible options are banner, alert, and custom. Setting the appearance to custom prevents Rebound from showing a notification. This is useful for presenting your own notification by hooking into window.ReboundSettings.complete.
position Position the banner or alert. Possible options are top, bottom, topRight, topLeft, bottom, bottomRight, and bottomLeft.
title The alert title that your user will see. Bounce data is also available and can be specified as variables: [[email]], [[reason]], and [[details]].
description The alert description that your user will see. Bounce data is also available and can be specified as variables: [[email]], [[reason]], and [[details]].

Simple markdown supported: [Link Text](http://example.com), **bold**, __italic__.
fallbackDescription Postmark deletes the bounce reason and details after 45 days. This will show a fallback description if this information is not available. The only variable available is [[email]].

Simple markdown supported: [Link Text](http://example.com), **bold**, __italic__.
actionUrl The URL where your user can update their email address. If left empty the button will not appear in the alert.
actionLabel The action button label.
repeat Repeatedly checks (a.k.a. polling) whether this recipient is inactive. This is super helpful if the user is on a page that relies on some sort of email confirmation. Accepts any number above 5000 milliseconds. Rebound will stop checking the recipient status if the address is marked as inactive.

window.ReboundSettings.complete

Returns a single argument that lets you know whether this recipient is marked as inactive due to a hard bounce. Rebound’s notification will not appear if the recipient was deactivated due to a spam complaint.


window.ReboundSettings = {
  // ...
  complete: function(response) {
    console.log(response)
  }
}

Example of the response object:


{
  inactive: true,
  data: {
    ID: 692560173,
    email: "email@example.com",
    reason: "The server was unable to deliver your message (ex: unknown user, mailbox not found).",
    details: "smtp;550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient\'s email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser m62si5018904ioe.219 - gsmtp",
    time: "2017-12-15T12:33:42-05:00"
  }
}

Name Description
inactive A boolean that let’s you know whether this recipient was marked inactive in Postmark due to a hard bounce. Inactive recipients will no longer receive your emails from Postmark unless they are manually reactivated.
ID The ID lets you interact with the bounce via Postmark’s Bounce API.
email Email address that is marked as inactive.
reason Reason for the bounce.
details A more detailed explanation of the bounce straight from the recipient’s server.
time When the bounce occurred.

window.Rebound.check(config)

By default, Rebound checks the email on page load. However, window.Rebound.check() lets you manually run checks, ideally when a user submits a form or clicks a button. This is helpful for notifying your users about potential email issues based on user action (e.g. sign up, invitation, or contact forms).

window.Rebound.check(config) accepts the standard config object as the first argument. See window.ReboundSettings above for more details.


<script>(function(r,e,b,o,u,n,d){if(r.Rebound)return;d=function(){o="script";u=e.createElement(o);u.type="text/javascript";u.src=b;u.async=true;n=e.getElementsByTagName(o)[0];n.parentNode.insertBefore(u,n)};if(r.attachEvent){r.attachEvent("onload",d)}else{r.addEventListener("load",d,false)}})(window,document,"https://rebound.postmarkapp.com/widget/1.0");</script>
<script>
  // Ideally when the user submits a form or clicks a button
  function yourEvent() {
    window.Rebound.check({
      publicToken: "public_token",
      email: "user_email"
    });
  }
</script>

Have any questions about Rebound? Feel free to reach out.