{"id":13819653,"url":"https://github.com/casdoor/go-sms-sender","last_synced_at":"2025-10-11T20:08:32.544Z","repository":{"id":43275937,"uuid":"365927873","full_name":"casdoor/go-sms-sender","owner":"casdoor","description":"A helper library to send SMS via 10+ channels, like Twilio, Amazon SNS, Azure ACS, etc.","archived":false,"fork":false,"pushed_at":"2024-11-29T14:08:06.000Z","size":73,"stargazers_count":68,"open_issues_count":0,"forks_count":50,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-23T16:23:39.029Z","etag":null,"topics":["amazon","amazon-sns","aws","casdoor","go","notification","sms","twilio"],"latest_commit_sha":null,"homepage":"https://github.com/casdoor/casdoor","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casdoor.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-10T05:28:11.000Z","updated_at":"2025-05-12T02:51:22.000Z","dependencies_parsed_at":"2024-01-13T16:21:02.861Z","dependency_job_id":"a5d8c4f7-7210-4ace-9fbf-f54709c7cc76","html_url":"https://github.com/casdoor/go-sms-sender","commit_stats":{"total_commits":44,"total_committers":23,"mean_commits":"1.9130434782608696","dds":0.7727272727272727,"last_synced_commit":"9fc8a7e2b6b49a16e9227cc9cd0f0029abbf1ff1"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/casdoor/go-sms-sender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fgo-sms-sender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fgo-sms-sender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fgo-sms-sender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fgo-sms-sender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casdoor","download_url":"https://codeload.github.com/casdoor/go-sms-sender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fgo-sms-sender/sbom","scorecard":{"id":267080,"data":{"date":"2025-08-11","repo":{"name":"github.com/casdoor/go-sms-sender","commit":"af78ac0e42f41e9cf6da1e5437cbabc2a7755b8a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":7,"reason":"Found 22/30 approved changesets -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/casdoor/go-sms-sender/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/casdoor/go-sms-sender/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/casdoor/go-sms-sender/ci.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:31","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:22"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0635","Warn: Project is vulnerable to: GO-2022-0646","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T12:21:54.291Z","repository_id":43275937,"created_at":"2025-08-17T12:21:54.291Z","updated_at":"2025-08-17T12:21:54.291Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008580,"owners_count":26084480,"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-10-11T02:00:06.511Z","response_time":55,"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":["amazon","amazon-sns","aws","casdoor","go","notification","sms","twilio"],"created_at":"2024-08-04T08:00:51.257Z","updated_at":"2025-10-11T20:08:32.514Z","avatar_url":"https://github.com/casdoor.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# go-sms-sender\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/casdoor/go-sms-sender)](https://goreportcard.com/report/github.com/casdoor/go-sms-sender)\n[![Go](https://github.com/casdoor/go-sms-sender/actions/workflows/ci.yml/badge.svg)](https://github.com/casdoor/go-sms-sender/actions/workflows/ci.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/casdoor/go-sms-sender.svg)](https://pkg.go.dev/github.com/casdoor/go-sms-sender)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/casdoor/go-sms-sender)\n\nThis is a powerful open-source library for sending SMS message, which will help you to easily integrate with the popular SMS providers. And it has been applied to [Casdoor](https://github.com/casdoor/casdoor), if you still don’t know how to use it after reading README.md, you can refer to it.\n\nWe support the following SMS providers, welcome to contribute.\n\n- [Twilio](https://www.twilio.com)\n- [Amazon SNS](https://aws.amazon.com/sns/)\n- [Azure ACS](https://azure.microsoft.com/en-us/products/communication-services)\n- [GCCPAY](https://gccpay.com/)\n- [Infobip](https://www.infobip.com/)\n- [SUBMAIL](https://en.mysubmail.com/)\n- [SmsBao](https://www.smsbao.com/)\n- [Alibaba Cloud](https://www.aliyun.com/product/sms)\n- [Tencent Cloud](https://cloud.tencent.com/document/product/382)\n- [Baidu Cloud](https://cloud.baidu.com/product/sms.html)\n- [VolcEngine](https://www.volcengine.com/product/cloud-sms)\n- [Huawei Cloud](https://www.huaweicloud.com/product/msgsms.html)\n- [UCloud](https://www.ucloud.cn/site/product/usms.html)\n- [Huyi](https://www.ihuyi.com/)\n- [Netgsm](https://www.netgsm.com.tr/)\n- [Oson Sms](https://osonsms.com/)\n\n## Installation\n\nUse `go get` to install：\n\n```\ngo get github.com/casdoor/go-sms-sender\n```\n\n## How to use\n\n### Create Client\n\nDifferent SMS providers need to provide different configuration, but we support a unit API as below to init and get the SMS client.\n\n```go\nfunc NewSmsClient(provider string, accessId string, accessKey string, sign string, template string, other ...string) (SmsClient, error)\n```\n\n- `provider` the name of SMS provider, such as `Aliyun SMS`\n- `accessId`\n- `accessKey`\n- `sign` the sign name\n- `template` the template code\n- `other` other configuration\n\n### Send Message\n\nAfter initializing the SMS client, we can use the following API to send message.\n\n```go\nSendMessage(param map[string]string, targetPhoneNumber ...string) error\n```\n\n- `param` the parameters in the SMS template, such as 6 random numbers\n- `targetPhoneNumber` the receivers, such as `+8612345678910`\n\n## Example\n\n### Twilio\n\nPlease get necessary information from Twilio [console](https://console.twilio.com/)\n\n```go\npackage main\n\nimport \"github.com/casdoor/go-sms-sender\"\n\nfunc main() {\n\tclient, err := go_sms_sender.NewSmsClient(go_sms_sender.Twilio, \"ACCOUNT_SID\", \"AUTH_TOKEN\", \"\", \"TEMPLATE_CODE\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tparams := map[string]string{}\n\tparams[\"code\"] = \"123456\"\n\tphoneNumer := \"+8612345678910\"\n\terr = client.SendMessage(params, phoneNumer)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n### Aliyun\n\nBefore you begin, you need to sign up for an Aliyun account and retrieve your [Credentials](https://usercenter.console.aliyun.com/#/manage/ak).\n\n```go\npackage main\n\nimport \"github.com/casdoor/go-sms-sender\"\n\nfunc main() {\n\tclient, err := go_sms_sender.NewSmsClient(go_sms_sender.Aliyun, \"ACCESS_KEY_ID\", \"ACCESS_KEY_SECRET\", \"SIGN_NAME\", \"TEMPLATE_CODE\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tparams := map[string]string{}\n\tparams[\"code\"] = \"473956\"\n\tphoneNumer := \"+8612345678910\"\n\terr = client.SendMessage(params, phoneNumer)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n### Tencent Cloud\n\n```go\npackage main\n\nimport \"github.com/casdoor/go-sms-sender\"\n\nfunc main() {\n\tclient, err := go_sms_sender.NewSmsClient(go_sms_sender.TencentCloud, \"secretId\", \"secretKey\", \"SIGN_NAME\", \"TEMPLATE_CODE\", \"APP_ID\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tparams := map[string]string{}\n\tparams[\"0\"] = \"473956\"\n\tphoneNumer := \"+8612345678910\"\n\terr = client.SendMessage(params, phoneNumer)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n### Netgsm\n\n- yourAccessId: is KullaniciAdi\n- yourAccessKey: is Sifre\n- yourSign: is Baslik\n\n```go\npackage main\n\nimport \"github.com/casdoor/go-sms-sender\"\n\nfunc main() {\n\tclient, err := go_sms_sender.NewSmsClient(go_sms_sender.Netgsm, \"yourAccessId\", \"yourAccessKey\", \"yourSign\", \"yourTemplate\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tparams := map[string]string{}\n\tparams[\"param1\"] = \"value1\"\n\tparams[\"param2\"] = \"value2\"\n\tphoneNumer := \"+8612345678910\"\n\terr = client.SendMessage(params, phoneNumer)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n### Oson Sms\n\n- senderId: is `login`\n- secretAccessKey: is `hash`\n- signName: is `from`\n- templateCode: is `message`\n\n```go\npackage main\n\nfunc main() {\n\tclient, err := go_sms_sender.NewSmsClient(go_sms_senderOsonSms, \"senderId\", \"secretAccessKey\", \"signName\", \"templateCode\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tparams := map[string]string{}\n\tparams[\"code\"] = \"123456\"\n\tphoneNumer := \"+992123456789\"\n\terr = client.SendMessage(params, phoneNumer)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n\n### Running Tests\n\nTo run tests for the `go-sms-sender` library, navigate to the root folder of the project in your terminal and execute the following command:\n\n```sh\ngo test -v ./...\n```\n\nyou can modify mock_test.go file to mock an other tests\n\n## License\n\nThis project is licensed under the [Apache 2.0 license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasdoor%2Fgo-sms-sender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasdoor%2Fgo-sms-sender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasdoor%2Fgo-sms-sender/lists"}