{"id":22050123,"url":"https://github.com/icapps/tree-house-communication","last_synced_at":"2025-07-23T23:35:33.547Z","repository":{"id":47662603,"uuid":"169072261","full_name":"icapps/tree-house-communication","owner":"icapps","description":"Provide easy communication to external services","archived":false,"fork":false,"pushed_at":"2022-07-25T17:15:27.000Z","size":1006,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-01T04:49:48.592Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icapps.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-04T12:02:46.000Z","updated_at":"2022-07-25T17:13:28.000Z","dependencies_parsed_at":"2022-09-06T13:10:56.474Z","dependency_job_id":null,"html_url":"https://github.com/icapps/tree-house-communication","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/icapps/tree-house-communication","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Ftree-house-communication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Ftree-house-communication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Ftree-house-communication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Ftree-house-communication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icapps","download_url":"https://codeload.github.com/icapps/tree-house-communication/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icapps%2Ftree-house-communication/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266768430,"owners_count":23981355,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-11-30T14:17:57.396Z","updated_at":"2025-07-23T23:35:33.520Z","avatar_url":"https://github.com/icapps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Treehouse Communication\n\nCommunication module written in TypeScript providing communication utilities.\n\n[![npm version](https://badge.fury.io/js/%40icapps%2Ftree-house-communication.svg)](https://badge.fury.io/js/%40icapps%2Ftree-house-communication)\n[![Dependencies](https://david-dm.org/icapps/tree-house-communication.svg)](https://david-dm.org/icapps/tree-house-communication.svg)\n[![Build Status](https://travis-ci.com/icapps/tree-house-communication.svg?branch=master)](https://travis-ci.com/icapps/tree-house-communication)\n[![Coverage Status](https://coveralls.io/repos/github/icapps/tree-house-communication/badge.svg)](https://coveralls.io/github/icapps/tree-house-communication)\n[![Greenkeeper badge](https://badges.greenkeeper.io/icapps/tree-house-communication.svg)](https://greenkeeper.io/)\n\n## General\n\nThis module is used to send emails with Mandrill and only template requests (for now).\n\n## Installation\n\n```shell\nnpm install @icapps/tree-house-communication\n```\n\n## Usage examples\n\n### Email using the mandrill api:\n\n```typescript\nimport * as treeHouse from 'tree-house-communication';\n\n// set Mandrill API key\ntreeHouse.setMandrillApiKey('secretMandrillKey');\n\n// Create email(s)\nconst mailInfo: ITemplateRequest = {\n  templateName: 'icapps-newsletter-template',\n  subject: 'My subject',\n  from: { email: 'info@icapps.be', name: 'Info icapps' },\n  to: [{\n    email: 'testAddress@gmail.com', name: 'Optional',\n    content: [{ name: 'greeting', value: 'Hello test!' }]\n  }],\n  globalContent: [{ name: 'news', value: 'content of big news' }],\n};\n\nconst extraMandrillOptions = {\n  async: true,\n  message: { bcc_address: 'test@gmail.com' }\n}\n\n// Send email(s)\nconst result = await treeHouse.sendEmailWithTemplate(mailInfo, extraMandrillOptions);\n```\n\n// example result\n\n```json\n[\n  {\n    \"email\": \"email@mail.com\",\n    \"status\": \"queued\",\n    \"_id\": \"e8b9d10ea47e47629d95b22fe200389d\"\n  },\n  {\n    \"email\": \"anotherEmail@mail.com\",\n    \"status\": \"queued\",\n    \"_id\": \"308274f983f14eb09d266dd9abe51546\"\n  }\n]\n```\n\nSee all [extraMandrillOptions](https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template)\n\n\n\n### Send text message using twilio:\n\n```typescript\nimport * as treeHouse from 'tree-house-communication'\n\n// set Mandrill API key\ntreeHouse.setTwilioAccountSid('twilioAccountSid');\ntreeHouse.setTwilioAuthToken('twilioAuthToken');\n\n// Send text message\nconst result = await treeHouse.sendTextMessage(mailInfo, extraMandrillOptions);\n```\n\n// example result\n```json\n{\n  \"account_sid\": \"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n  \"api_version\": \"2010-04-01\",\n  \"body\": \"This is the ship that made the Kessel Run in fourteen parsecs?\",\n  \"date_created\": \"Thu, 30 Jul 2015 20:12:31 +0000\",\n  \"date_sent\": \"Thu, 30 Jul 2015 20:12:33 +0000\",\n  \"date_updated\": \"Thu, 30 Jul 2015 20:12:33 +0000\",\n  \"direction\": \"outbound-api\",\n  \"error_code\": null,\n  \"error_message\": null,\n  \"from\": \"+15017122661\",\n  \"messaging_service_sid\": \"MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n  \"num_media\": \"0\",\n  \"num_segments\": \"1\",\n  \"price\": null,\n  \"price_unit\": null,\n  \"sid\": \"SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n  \"status\": \"sent\",\n  \"subresource_uris\": {\n    \"media\": \"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media.json\"\n  },\n  \"to\": \"+15558675310\",\n  \"uri\": \"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json\"\n}\n```\n\n## Tests\n\n- You can run `npm run test` to run all tests\n- You can run `npm run test:coverage` to run all tests with coverage report\n\n## Authors\n\nSee the list of [contributors](https://github.com/icapps/tree-house-communication/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the ISC License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficapps%2Ftree-house-communication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficapps%2Ftree-house-communication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficapps%2Ftree-house-communication/lists"}