{"id":26678283,"url":"https://github.com/telexintegrations/email-open-rate-integration","last_synced_at":"2025-03-26T05:15:22.872Z","repository":{"id":278956077,"uuid":"937266182","full_name":"telexintegrations/email-open-rate-integration","owner":"telexintegrations","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-22T18:54:34.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T19:33:55.377Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/telexintegrations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-22T18:17:13.000Z","updated_at":"2025-02-22T18:54:37.000Z","dependencies_parsed_at":"2025-02-22T19:34:00.698Z","dependency_job_id":"72438cfd-38e0-4be1-aa13-158eee120b32","html_url":"https://github.com/telexintegrations/email-open-rate-integration","commit_stats":null,"previous_names":["telexintegrations/email-open-rate-integration"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Femail-open-rate-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Femail-open-rate-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Femail-open-rate-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Femail-open-rate-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telexintegrations","download_url":"https://codeload.github.com/telexintegrations/email-open-rate-integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245591533,"owners_count":20640692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-26T05:15:22.254Z","updated_at":"2025-03-26T05:15:22.849Z","avatar_url":"https://github.com/telexintegrations.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mailchimp Campaign Stats Integration\n\n### Overview\n\nThis integration fetches campaign performance statistics from Mailchimp and sends a structured summary to a specified Telex channel via a webhook. It provides insights into key metrics such as open rates, click rates, bounces, and unsubscribes.\n\n## Table of Contents\n\n- [Live url](#url)\n- [Overview](#overview)\n- [Features](#features)\n- [Technology Stack](#technology-stack)\n- [Project Setup](#project-setup)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Environment Variables](#environment-variables)\n  - [Running the Application](#running-the-application)\n- [Run Test](#run-test)\n- [Screenshot](#Screenshot)\n- [API Documentation](#api-documentation)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Live url\n\n`https://email-tracking-f7t5.onrender.com/api/v1/`\n\n# Features\n\n- Fetch campaign reports from Mailchimp\n\n- Extract key performance metrics (opens, clicks, bounces, unsubscribes, etc.)\n\n- Format statistics into a readable summary\n\n- Send campaign performance stats to Telex via webhook\n\n## Technology Stack\n\n- **Backend:** Node.js with Express.js (typescript).\n- **Hosting:** Render\n\n## Project Setup\n\n### Prerequisites\n\nBefore setting up the project, ensure you have the following installed:\n\n- [Node.js](https://nodejs.org/) (v14 or later)\n- [Yarn](https://yarnpkg.com/) (v1.x)\n- [PostgreSQL](https://www.postgresql.org/) (Ensure the database is running and accessible)\n- Ensure redis is running on your system or server.\n\n### Installation\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/LivingHopeDev/email-open-rate-tracking-integration.git\n   cd email-open-rate-tracking-integration\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   yarn install\n   ```\n\n### Environment Variables\n\nCreate a `.env` file in the root of the project and configure the following environment variables:\nCheck `.env.example ` file\n\n```env\n\nMAILCHIMP_API_KEY= # Your mailchimp API key\nMAILCHIMP_DATA_CENTER=\"usX\"\nFROM_EMAIL=   # Your mailchimp email\nTELEX_WEB_HOOK=   # Your webhook from telex channel\n\n\n```\n\n### Running the Application\n\n#### Start the development server\n\n```\nyarn run start:dev\n\n```\n\n## API Usage\n\n### Send email campaigne\n\n- Simulate sending an email from your mailchimp account by using the API Endpoint below:\n- The ListId is the Audience ID from your Mailchimp account that contains the list of email subscriber.\n- You can use the details in the documentation for testing.\n\n```\nPOST /api/v1/email/send\n```\n\n### Receive Notification about the status of the email campaigne\n\n- Telex sends a notification to the channel every 30 minutes to display the number of emails sent and how many subscribers have opened the email with other information.\n- Telex will hit this tick endpoint.\n\n```\nPOST /api/v1/email/stats/all\n```\n\n# API Documentation\n\n### 1. Send Email Campaign\n\n`POST /api/v1/email/send`\n\n**Request Body:**\n\n```json\n{\n  \"listId\": \"8e21609af5\", # Audience ID from mailchimp\n  \"subject\": \"Telex integration\",\n  \"htmlContent\": \"This is the latest newsletter for the telex integration\",\n  \"fromName\": \"sender's name\",\n  \"replyTo\": \"sender's email\"\n}\n\n```\n\n**Response:**\n\n```\n{\n  \"message\": \"Campaign created and sent successfully.\",\n  \"campaignId\": \"\u003ccampaign_id\u003e\",\n  \"sendResponse\": \"\u003cmailchimp_response\u003e\"\n}\n```\n\n### 2. Get All Campaign Stats\n\n- Telex sends a `POST` request to the tick url\n  **Endpoint**\n  `POST /api/v1/email/stats/all`\n\n**Response:**\n\n```json\n{\n  \"status\": 200,\n  \"message\": \"Campaign stats fetched and sent successfully!\"\n}\n```\n\n### 3. Get Single Campaign Stats\n\n**Endpoint**\n\n`GET /api/v1/email/stats/{campaignId}`\n**Response:**\n\n```json\n{\n  \"stats\": {\n    \"total_recipients\": 2,\n    \"total_opens\": 1,\n    \"unique_opens\": 1,\n    \"open_rate\": 0.5,\n    \"last_open\": \"2025-02-20T13:57:02+00:00\",\n    \"bounces\": 0\n  }\n}\n```\n\n### Webhook Integration\n\n- Campaign statistics are automatically sent to Telex via a webhook.\n\n#### Access the application\n\nThe server will start on the specified PORT in your .env file. If PORT is set to 8000, the application will be available at \u003chttp://localhost:5000\u003e.\n\n### Run Test\n\n```\nyarn test\n```\n\n### Screenshot\n\n![integration screenshot](./telex.png)\n\n### License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n### Key Points\n\n- The `README.md` provides a comprehensive guide on setting up the project locally, including installation instructions, environment variable configuration, and starting the server.\n- Since the API documentation is not yet available, it includes a placeholder indicating that it will be provided later.\n- The setup instructions are tailored specifically for a Node.js and PostgreSQL environment using Yarn.\n\nThis `README.md` file should serve as a solid foundation for your project documentation. Let me know if you need any changes or additional information!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Femail-open-rate-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelexintegrations%2Femail-open-rate-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Femail-open-rate-integration/lists"}