{"id":18903544,"url":"https://github.com/odroe/easysms","last_synced_at":"2026-04-03T02:02:38.173Z","repository":{"id":44456813,"uuid":"282181871","full_name":"odroe/easysms","owner":"odroe","description":"Easy to use, simple configuration can send SMS messages to Phone. Easily expandable gateways, messages customized according to scenarios.","archived":false,"fork":false,"pushed_at":"2025-04-15T16:43:42.000Z","size":132,"stargazers_count":11,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T04:27:25.333Z","etag":null,"topics":["dart","easysms","flutter","flutter-plugin","sms"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/easysms","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/odroe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2020-07-24T09:46:52.000Z","updated_at":"2025-04-07T01:04:17.000Z","dependencies_parsed_at":"2024-01-10T23:01:09.571Z","dependency_job_id":"593f9f2d-eb2b-4c66-86bc-821c81478c19","html_url":"https://github.com/odroe/easysms","commit_stats":{"total_commits":91,"total_committers":5,"mean_commits":18.2,"dds":0.5164835164835164,"last_synced_commit":"d29eff2725d2130b745081046b17208058eea8a4"},"previous_names":["bytegem/cloudbase"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/odroe/easysms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Feasysms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Feasysms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Feasysms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Feasysms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odroe","download_url":"https://codeload.github.com/odroe/easysms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Feasysms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260568692,"owners_count":23029351,"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":["dart","easysms","flutter","flutter-plugin","sms"],"created_at":"2024-11-08T09:05:29.870Z","updated_at":"2026-01-11T13:38:38.735Z","avatar_url":"https://github.com/odroe.png","language":"Dart","funding_links":["https://github.com/sponsors/odroe"],"categories":[],"sub_categories":[],"readme":"# EasySMS\n\nEasy to use, simple configuration can send SMS messages to Phone. Easily expandable gateways, messages customized according to scenarios.\n\n[![pub package](https://img.shields.io/pub/v/easysms.svg)](https://pub.dev/packages/easysms)\n[![test](https://github.com/odroe/easysms/actions/workflows/test.yml/badge.svg)](https://github.com/odroe/easysms/actions/workflows/test.yml)\n\n## Installation\n\nThis will add a line like this to your packages `pubspec.yaml` (and run an implicit `dart pub get`):\n\n```yaml\ndependencies:\n  easysms: latest\n```\n\nOr install it from the command line:\n\n```shell\ndart pub add easysms\n```\n\n## Features\n\n- **Gateway**: Support multiple gateways, you can customize the gateway according to your needs.\n- **Message**: Support multiple message templates, you can customize the message according to your needs.\n- **Universal**: Universal design, no need to write separate handlers for each service provider.\n- **Strategy**: Support gateway selection strategy.\n- **Retry**: Support gateway and strategy based retry mechanism.\n\n## Sponsors\n\nEasySMS is an [BSD-3 Clause licensed](LICENSE) open source project with its ongoing development made possible entirely by the support of these awesome backers. If you'd like to join them, please consider [sponsoring Odroe development](https://github.com/sponsors/odroe).\n\n\u003cp align=\"center\"\u003e\n  \u003ca target=\"_blank\" href=\"https://github.com/sponsors/odroe#sponsors\"\u003e\n    \u003cimg alt=\"sponsors\" src=\"https://github.com/odroe/.github/raw/main/sponsors.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Usage\n\n```dart\nimport 'package:easysms/easysms.dart';\n\nfinal easysms = EasySMS(\n  gateways: [...] // Gateway list\n);\n\nfinal message = Message.fromValues(\n  template: '\u003cYou template ID\u003e',\n  data: {\n    'SignName': \"\u003cYou sign name\u003e\",\n    'TemplateParamSet': [\n      '\u003cParam 1\u003e',\n      '\u003cParam 2\u003e',\n      // ...\n    ],\n  },\n);\n\nmain() async {\n  final phone = PhoneNumber('\u003cYou country code\u003e', '\u003cYou phone number\u003e');\n  final response = await easysms.send([phone], message);\n\n  print('Status: ${response.first.success}'); // true or false\n}\n```\n\n## Message\n\nYou can create your own scene messages based on the message:\n\n```dart\nimport 'package:easysms/easysms.dart';\n\nclass OneTimePasswordMessage implements Message {\n  final String password;\n  final Duration ttl;\n\n  OneTimePasswordMessage(this.password, this.ttl);\n\n  @override\n  Future\u003cMap\u003cString, dynamic\u003e\u003e toData(Gateway gateway) {\n    // ...\n  }\n\n  @override\n  Future\u003cString\u003e toTemplate(Gateway gateway) {\n    // ...\n  }\n\n  @override\n  Future\u003cString\u003e toText(Gateway gateway) {\n    // ...\n  }\n}\n```\n\n### Built-in Message\n\n#### `formValues`\n\n```dart\nfinal message = Message.fromValues(\n  text: '\u003cYou message text\u003e',\n  template: '\u003cYou template ID\u003e',\n  data: {\n    // ...\n  },\n);\n```\n\n#### `fromCallbacks`\n\n```dart\nfinal message = Message.fromCallbacks(\n  text: (gateway) async =\u003e '\u003cYou message text\u003e',\n  template: (gateway) async =\u003e '\u003cYou template ID\u003e',\n  data: (gateway) async =\u003e {\n    // ...\n  },\n);\n```\n\n## Gateways\n\n| Gateway                  | Platform                                                   | Description               |\n| ------------------------ | ---------------------------------------------------------- | ------------------------- |\n| `TencentCloudSmsGateway` | [Tencent Cloud SMS](https://cloud.tencent.com/product/sms) | Tencent Cloud SMS gateway |\n| `SmsBaoGateway`          | [短信宝](https://www.smsbao.com/)                          | 短信宝 SMS gateway        |\n\n**If the platform you need to use is not listed here, you have several ways to support it:**\n\n1. Create an [issue](https://github.com/odroe/easysms/issues/new) to request support for the platform.\n2. Create an [pull request](https://github.com/odroe/easysms/pulls) to add support for the platform.\n3. You can create a gateway Dart package yourself,\n4. You can implement the gateway yourself in your project without telling anyone.\n\n### How to create a gateway\n\nYou must depend on the `easysms` package and implement the `Gateway` interface:\n\n```dart\nimport 'package:easysms/easysms.dart';\n\nclass MyGateway implements Gateway {\n  @override\n  Future\u003cIterable\u003cResponse\u003e\u003e send(\n      Iterable\u003cPhoneNumber\u003e to, Message message, http.Client client) async {\n        // ...\n      }\n}\n```\n\nYou can refer to [all the gateways](/lib/) we have implemented.\n\n## Strategies\n\nEasySMS allows you to customize the gateway selection strategy.\n\n```dart\nclass MyStrategy implements Strategy {\n  @override\n  Future\u003cGateway\u003e select(Iterable\u003cGateway\u003e gateways) async {\n    // ...\n  }\n}\n```\n\nWe implemented a built-in strategy, for example, you can use the `OrderStrategy`:\n\n```dart\nfinal easysms = EasySMS(\n  gateways: [...],\n  strategy: const OrderStrategy(),\n);\n```\n\n**Note**: The `OrderStrategy` will select the gateway in the order of the gateway list.\n\n## Contributing\n\nWe welcome contributions! Please read our [contributing guide](CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to EasySMS.\n\nThank you to all the people who already contributed to Odroe!\n\n[![Contributors](https://opencollective.com/openodroe/contributors.svg?width=890)](https://github.com/odroe/prisma-dart/graphs/contributors)\n\n## Stay in touch\n\n- [Website](https://odroe.com)\n- [Twitter](https://twitter.com/odroeinc)\n- [Discord](https://discord.gg/r27AjtUUbV)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodroe%2Feasysms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodroe%2Feasysms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodroe%2Feasysms/lists"}