{"id":19622173,"url":"https://github.com/commercetools/connect-email-integration-template","last_synced_at":"2026-05-27T16:31:17.114Z","repository":{"id":221122763,"uuid":"742450988","full_name":"commercetools/connect-email-integration-template","owner":"commercetools","description":"Toolkit for developing an Email integration with commercetools","archived":false,"fork":false,"pushed_at":"2025-12-02T19:26:51.000Z","size":465,"stargazers_count":1,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-02T03:58:34.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commercetools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-12T14:05:54.000Z","updated_at":"2025-05-06T08:27:41.000Z","dependencies_parsed_at":"2024-02-06T10:25:50.790Z","dependency_job_id":"2db05f67-55d9-4635-94d1-9c670e53798f","html_url":"https://github.com/commercetools/connect-email-integration-template","commit_stats":null,"previous_names":["commercetools/connect-email-integration-template"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/commercetools/connect-email-integration-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-email-integration-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-email-integration-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-email-integration-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-email-integration-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/connect-email-integration-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-email-integration-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33575510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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-11T11:26:26.912Z","updated_at":"2026-05-27T16:31:17.108Z","avatar_url":"https://github.com/commercetools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# connect-email-integration-template\nThis repository provides a [connect](https://docs.commercetools.com/connect) template for a email integration connector for notification performed by external email service provider. This boilerplate code acts as a starting point for such integration.\n\nThis template uses the [Customer](https://docs.commercetools.com/api/projects/customers),  [Order](https://docs.commercetools.com/api/projects/orders) data models from commercetools composable commerce. Template is based on [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions) to communicate with the external email provider asynchronously.\n\n## Template Features\n- NodeJS supported.\n- Uses Express as web server framework.\n- Uses [commercetools SDK](https://docs.commercetools.com/sdk/js-sdk-getting-started) for the commercetools-specific communication.\n- Includes local development utilities in npm commands to build, start, test, lint \u0026 prettify code.\n- Uses JSON formatted logger with log levels\n- Setup sample unit and integration tests with [sinon](https://sinonjs.org/), [Jest](https://jestjs.io/) and [supertest](https://github.com/ladjs/supertest#readme)\n\n## Prerequisite\n#### 1. commercetools composable commerce API client\nUsers are expected to create API client responsible for fetching customer and order details from composable commerce project, API client should have enough scope to be able to do so. These API client details are taken as input as an environment variable/ configuration for connect. Details of composable commerce project can be provided as environment variables (configuration for connect) `CTP_PROJECT_KEY` , `CTP_CLIENT_ID`, `CTP_CLIENT_SECRET`, `CTP_SCOPE`, `CTP_REGION`. For details, please read [Deployment Configuration](./README.md#deployment-configuration).\n\n#### 2. external email service provider\n- Users are expected to create api clients/ keys in external email service provider. Those details are taken as input as an environment variable / configuration for connect. API token to external email service provider can be provided as environment variables (configuration for connect) `EMAIL_PROVIDER_API_KEY`.For details, please read [Deployment Configuration](./README.md#deployment-configuration).\n- In additions, users are expected to create their own email template on the platform of email service provider for following operations :\n1. Customer Registration\n2. Email Token Generation\n3. Password Reset Token Generation\n4. Order Confirmation\n5. Order/Shipment State Update\n6. Order Refund\n\nThe keys or identifiers of templates built in external email provider can be provided as several environment variables (configuration for connect) `CUSTOMER_REGISTRATION_TEMPLATE_ID`, `CUSTOMER_EMAIL_TOKEN_CREATION_TEMPLATE_ID`, `CUSTOMER_PASSWORD_TOKEN_CREATION_TEMPLATE_ID`, `ORDER_CONFIRMATION_TEMPLATE_ID`, `ORDER_STATE_CHANGE_TEMPLATE_ID` and `ORDER_REFUND_TEMPLATE_ID`. For details, please read [Deployment Configuration](./README.md#deployment-configuration).\n \n## Getting started\nThe template contains following module :  \n- Mail Sender: Receives message from commercetools project once there is an operation in customer or order as listed [here](./README.md#2-external-email-service-provider). \n\nRegarding the development of mail sender module, please refer to the following documentations:\n- [Development of Mail Sender](mail-sender/README.md)\n\n#### 1. Develop your specific needs \nTo send email notification with corresponding order/customer details via external email provider, users need to extend this connector with the following task\n- API communication: Implementation to communicate between this connector application and the external system using libraries provided by external email provider. Please remember that the email notification request might not be sent to email provider API successfully in a single attempt. It should have needed retry and recovery mechanism.\n\n#### 2. Register as connector in commercetools Connect\nFollow guidelines [here](https://docs.commercetools.com/connect/getting-started) to register the connector for public/private use.\n\n## Deployment Configuration\nIn order to deploy your customized connector application on commercetools Connect, it needs to be published. For details, please refer to [documentation about commercetools Connect](https://docs.commercetools.com/connect/concepts)\nIn addition, in order to support connect, the email integration connector template has a folder structure as listed below\n```\n├── mail-sender\n│   ├── src\n│   ├── test\n│   └── package.json\n└── connect.yaml\n```\n\nConnect deployment configuration is specified in `connect.yaml` which is required information needed for publishing of the application. Following is the deployment configuration used by full ingestion and incremental updater modules\n```\ndeployAs:\n  - name: mail-sender\n    applicationType: event\n    endpoint: /mailSender\n    scripts:\n      postDeploy: npm install \u0026\u0026 npm run connector:post-deploy\n      preUndeploy: npm install \u0026\u0026 npm run connector:pre-undeploy\n    configuration:\n      standardConfiguration:\n        - key: CTP_REGION\n          description: region of commercetools composable commerce project\n      securedConfiguration:\n        - key: CTP_PROJECT_KEY\n          description: commercetools project key\n        - key: CTP_CLIENT_ID\n          description: commercetools client ID\n        - key: CTP_CLIENT_SECRET\n          description: commercetools client secreet\n        - key: CTP_SCOPE\n          description: commercetools client scope\n        - key: EMAIL_PROVIDER_API_KEY\n          description: The API key used to communicate with email provider\n        - key: SENDER_EMAIL_ADDRESS\n          description: sender's email address displayed in the email\n        - key: CUSTOMER_REGISTRATION_TEMPLATE_ID\n          description: Identifier of customer registration email template stored in email service provider\n        - key: CUSTOMER_EMAIL_TOKEN_CREATION_TEMPLATE_ID\n          description: Identifier of email token creation email template stored in email service provider\n        - key: CUSTOMER_PASSWORD_TOKEN_CREATION_TEMPLATE_ID\n          description: Identifier of password token creation email template stored in email service provider\n        - key: ORDER_CONFIRMATION_TEMPLATE_ID\n          description: Identifier of order confirmation email template stored in email service provider\n        - key: ORDER_STATE_CHANGE_TEMPLATE_ID\n          description: Identifier of order state change / shipment state change email template stored in email service provider\n        - key: ORDER_REFUND_TEMPLATE_ID\n          description: Identifier of order refund email template stored in email service provider\n```\n\nHere you can see the details about various variables in configuration\n- CTP_PROJECT_KEY: The key of commercetools composable commerce project.\n- CTP_CLIENT_ID: The client ID of your commercetools composable commerce user account. It is used in commercetools client to communicate with commercetools composable commerce via SDK.\n- CTP_CLIENT_SECRET: The client secret of commercetools composable commerce user account. It is used in commercetools client to communicate with commercetools composable commerce via SDK.\n- CTP_SCOPE: The scope constrains the endpoints to which the commercetools client has access, as well as the read/write access right to an endpoint.\n- CTP_REGION: As the commercetools composable commerce APIs are provided in six different region, it defines the region which your commercetools composable commerce user account belongs to.\n- EMAIL_PROVIDER_API_KEY: It defines the API key provided by the external email service provider, which is used to access their API from the connector application.\n- SENDER_EMAIL_ADDRESS: It defines the email address of sender, which is passed to email template stored in email service provider so that it can be displayed in email notification.\n- CUSTOMER_REGISTRATION_TEMPLATE_ID: It defines the key or identifier of customer registration email template stored in email service provider.\n- CUSTOMER_EMAIL_TOKEN_CREATION_TEMPLATE_ID: It defines the key or identifier of email token creation email template stored in email service provider.\n- CUSTOMER_PASSWORD_TOKEN_CREATION_TEMPLATE_ID: It defines the key or identifier of password token creation email template stored in email service provider.\n- ORDER_CONFIRMATION_TEMPLATE_ID: It defines the key or identifier of order confirmation email template stored in email service provider.\n- ORDER_STATE_CHANGE_TEMPLATE_ID: It defines the key or identifier of order/shipment state change email template stored in email service provider.\n- ORDER_REFUND_TEMPLATE_ID: It defines the key or identifier of order refund email template stored in email service provider.\n\n\n## Recommendations\n#### Implement your own test cases\nWe have provided sample unit and integration test cases with [sinon](https://sinonjs.org/), [Jest](https://jestjs.io/) and [supertest](https://github.com/ladjs/supertest#readme). The implementation is under `test` folder in `mail-sender` module. It is recommended to implement further test cases based on your own needs to test your development.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-email-integration-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Fconnect-email-integration-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-email-integration-template/lists"}