Giter Club home page Giter Club logo

ukforeignoffice.notify-test's Introduction

Test script - sending mass emails using Notify API

To check that the Notify API can process the advertised 3000 messages per minute.

Running the script

  1. Get a test Notify API key Get a test key generated from the Notify dashboard. (Note, if you use a live key instead for this kind of testing it's against Notify terms and your account could get blocked. Test keys let you send large quantities of messages that appear in the Notify dashboard, but don't actually send the emails out.)

  2. Set up a dummy Notify message template Create your message template in the Notify dashboard and grab the id, to replace the one in the script.

NOTIFY_TEST_API_KEY=<api key> node index.js

Possible Notify API errors

Notify error code docs

Exceeded rate limit - You may have run the script more than once per minute, exceeding the 3000/min limit.

Your system clock must be accurate to within 30 seconds - this can be misleading. The error occurs if the timestamp of the request is > 30s before the time when the Notify server receives and processes it. This could be due to your system clock on your laptop being out, but more likely is that there was a delay before the request was actually sent. Modifying Node.js connection pooling is a possible cause. eg:

https.globalAgent.maxSockets = 30;

Using Wireshark to monitor requests out

Follow these instructions to set up. Pass the path to the SSL key log file as an env variable:

SSLKEYLOGFILE=/Users/<you>/ssl_key_log_file.log NOTIFY_TEST_API_KEY=<api key> node index.js

In Wireshark, capture the Wi-Fi en0 interface. Filter requests with http contains "/notifications/email"

ukforeignoffice.notify-test's People

Contributors

jonnywyatt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.