WebhookJob constructor
Get if the response to the webhook was already sent or not.
Set if the response to the webhook was already sent or not.
Create a new life event.
Sends an email.
Email options
// my_tunnel.js
tunnel.run(function (job, nest) {
job.email({
subject: "Test email from pug template",
to: "john.smith@example.com",
template: "./template_files/my_email.pug"
});
});
// template_files/my_email.pug
h1="Example email!"
p="Got job ID " + job.getId()
tunnel.run(function (job, nest) {
job.email({
subject: "Test email with hard-coded plain-text",
to: "john.smith@example.com",
text: "My email body!"
});
});
tunnel.run(function (job, nest) {
job.email({
subject: "Test email with hard-coded html",
to: "john.smith@example.com",
html: "<h1>My email body!</h1>"
});
});
Function to call to fail a job while in a tunnel.
Get a string from the request body. The given callback is given a string parameter.
webhookJob.getDataAsString(function(requestBody){
console.log(requestBody);
});
Returns FileJobs made from files sent via FormData to the webhook.
Get a single FormData value.
Get all FormData values.
Get the ID.
Get the life cycle object.
Get the name.
Get the name proper.
Get the nest.
Returns a parameter from both the query string and form-data.
Returns an array of parameters from both the query string and form-data.
Return a specific URL parameter.
// Webhook URL: /hooks/my/hook?customer_id=MyCust
var customer_id = webhookJob.getUrlParameter("customer_id");
// customer_id => MyCust
Return all URl parameters.
// Webhook URL: /hooks/my/hook?customer_id=MyCust&file_name=MyFile.zip
var query = webhookJob.getUrlParameters();
// query => {customer_id: "MyCust", file_name: "MyFile.zip"}
Get the HTTP request object.
Get the HTTP response object.
Get the tunnel.
Check if job is locally available.
Move function error.
Set if the job is locally available.
Set a new name.
Set the nest.
Set the tunnel.
Class name for logging.
Transfer a job to another tunnel directly.
Generated using TypeDoc
A job that is triggered when a webhook receives a request.