Unsubscribe

Click unsubscribe links and get webpage information

Overview

This node automates the process of handling unsubscribe links typically found in emails or webpages. It supports two main operations:

  • Click Unsubscribe Link: Given an unsubscribe URL, the node performs an HTTP GET request to that URL, simulating a user clicking the unsubscribe link. It then analyzes the resulting webpage to extract useful information such as page title, HTTP status, content type, and whether the page confirms successful unsubscription by searching for common confirmation phrases.

  • Extract Links from Email: Given raw email content, the node scans the text to find URLs that likely correspond to unsubscribe or opt-out links by matching common keywords like "unsubscribe", "opt-out", "remove", "cancel", and "stop".

Practical Examples

  • Automatically confirm unsubscriptions by clicking unsubscribe links extracted from marketing emails.
  • Extract all potential unsubscribe links from bulk email content for further processing or reporting.
  • Integrate into workflows that manage mailing list subscriptions by verifying unsubscribe actions.

Properties

Name Meaning
Operation Choose between "Click Unsubscribe Link" (perform HTTP GET on a given URL) or "Extract Links from Email" (parse email content for unsubscribe URLs).
Unsubscribe URL The URL to visit when performing the "Click Unsubscribe Link" operation.

Note: The "Unsubscribe URL" property is only shown and required when the selected operation is "Click Unsubscribe Link".

Output

The node outputs JSON data with the following structure depending on the operation:

For "Click Unsubscribe Link"

{
  "success": true,
  "operation": "click_link",
  "url": "https://example.com/unsubscribe",
  "result": {
    "success": true,
    "webpageInfo": {
      "statusCode": 200,
      "statusMessage": "OK",
      "headers": { /* HTTP response headers */ },
      "url": "https://example.com/unsubscribe",
      "finalUrl": "https://example.com/unsubscribe",
      "contentType": "text/html; charset=UTF-8",
      "contentLength": "12345",
      "title": "Unsubscribe Confirmation",
      "hasUnsubscribeConfirmation": true,
      "redirects": [ /* array of redirect objects if any */ ]
    },
    "message": "Successfully accessed unsubscribe page. Status: 200"
  },
  "timestamp": "2024-06-01T12:00:00.000Z"
}
  • success: Indicates if the HTTP request was successful.
  • webpageInfo: Contains detailed info about the fetched page including HTTP status, headers, final URL after redirects, page title, and a boolean indicating if unsubscribe confirmation phrases were detected.
  • message: Human-readable summary of the result.
  • timestamp: ISO timestamp of execution.

If the request fails, success will be false and an error message will be included.

For "Extract Links from Email"

{
  "success": true,
  "operation": "extract_links",
  "links": [
    "https://example.com/unsubscribe",
    "https://example.com/opt-out"
  ],
  "totalFound": 2,
  "timestamp": "2024-06-01T12:00:00.000Z"
}
  • links: Array of unique unsubscribe-related URLs found in the provided email content.
  • totalFound: Number of unique links extracted.
  • timestamp: ISO timestamp of execution.

Dependencies

  • Requires internet access to perform HTTP requests when clicking unsubscribe links.
  • Uses built-in HTTP request helper with authentication support (e.g., basic auth) if configured.
  • No external API keys are explicitly required but may be needed if the unsubscribe URL requires authentication.
  • The node sets a custom User-Agent header identifying itself as an unsubscribe bot.

Troubleshooting

  • Missing URL for Click Operation: If the "Unsubscribe URL" property is empty when running the "Click Unsubscribe Link" operation, the node throws an error stating the URL is required.
  • HTTP Request Failures: Network issues, invalid URLs, or server errors can cause the HTTP request to fail. The node returns a failure message with the error details.
  • No Unsubscribe Confirmation Detected: The node searches for common confirmation phrases in the page content. If none are found, it does not guarantee unsubscription succeeded—manual verification might be necessary.
  • Empty Email Content for Extraction: Running the "Extract Links from Email" operation without providing email content results in an error.
  • Timeouts: The HTTP request has a 30-second timeout; slow servers may cause timeouts.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion