{"id":29572691,"url":"https://github.com/accelbyte/justice-go-common-email","last_synced_at":"2025-08-01T19:05:06.952Z","repository":{"id":175248613,"uuid":"653542627","full_name":"AccelByte/justice-go-common-email","owner":"AccelByte","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-20T04:26:52.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-19T08:48:51.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/AccelByte.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,"zenodo":null}},"created_at":"2023-06-14T08:53:49.000Z","updated_at":"2024-08-20T04:20:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"6dee8b8d-f83e-4332-b69a-0397fb109682","html_url":"https://github.com/AccelByte/justice-go-common-email","commit_stats":null,"previous_names":["accelbyte/justice-go-common-email"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/AccelByte/justice-go-common-email","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fjustice-go-common-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fjustice-go-common-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fjustice-go-common-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fjustice-go-common-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AccelByte","download_url":"https://codeload.github.com/AccelByte/justice-go-common-email/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fjustice-go-common-email/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268139290,"owners_count":24202442,"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-31T02:00:08.723Z","response_time":66,"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":"2025-07-19T05:10:53.118Z","updated_at":"2025-08-01T19:05:06.895Z","avatar_url":"https://github.com/AccelByte.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# justice-go-common-email\n\nGo SDK for email sender functionality in AccelByte services.\n\n## Usage\n\n### Install\n\n```\ngo get -u github.com/AccelByte/justice-go-common-email\n```\n\n### Importing\n\n```go\n\"github.com/AccelByte/justice-go-common-email\"\n```\nTo create a new email sender client, use this function:\n```go\n// If using static configuration\nemailSender, errEmailSender := emailsender.NewEmailSender(emailsender.StaticSource)\n\n// If using config service configuration\nemailSender, errEmailSender := emailsender.NewEmailSender(emailsender.ConfigServiceSource)\n```\n\nExample initialize email sender client by environment variable:\n```go\nvar emailConfigSource emailsender.EmailConfigSource\nif str := os.Getenv(\"APP_EMAIL_CONFIG_SOURCE\"); str != \"\" { // using environment variable to decide the source config\n\tif str == string(emailsender.StaticSource) {\n\t\temailConfigSource = emailsender.StaticSource\n\t} else if str == string(emailsender.ConfigServiceSource) {\n\t\temailConfigSource = emailsender.ConfigServiceSource\n\t}\n}\nif emailConfigSource == nil {\n\treturn errors.New(\"Source config is not valid\")\n}\nemailSender, errEmailSender := emailsender.NewEmailSender(emailConfigSource)\nif errEmailSender != nil {\n\treturn errEmailSender\n}\n```\n\n## Supported Email Sender Configuration\n### Static Configuration\n\nRead email sender configuration from environment variables.\n\nExample initialization:\n```go\nemailSender, errEmailSender := emailsender.NewEmailSender(emailsender.StaticSource)\n```\n\n#### Environment Variables\n\n| Environment Variable  | Description                                             |\n|-----------------------|---------------------------------------------------------|\n| APP_EMAIL_SENDER_NAME | Email sender platform. options: `sendgrid`, `mandrill`. |\n| FROM_EMAIL_ADDRESS    | From email address, required.                           |\n| FROM_EMAIL_NAME       | From email name.                                        |\n\n##### If using `sendgrid` platform:\u003c/b\u003e\n\n| Environment Variable      | Description                 |\n|---------------------------|-----------------------------|\n| SENDGRID_API_KEY          | Sendgrid API Key, required. |\n| SENDGRID_EMAIL_CATEGORIES | Sendgrid email categories.  |\n\n##### If using `mandrill` platform:\n\nThere are 2 mode available when using `mandrill` platform: API and SMTP.\nYou could decide which mode you want to activate by configuring the environment variables below, then it will automatically use the configured one:\n\n| Environment Variable      | Description                                          | Mode   |\n|---------------------------|------------------------------------------------------|--------|\n| MANDRILL_API_URL          | Mandrill API URL (default: https://mandrillapp.com). | API    |\n| MANDRILL_API_KEY          | Mandrill API Key.                                    | API    |\n| MANDRILL_SMTP_HOST        | Mandrill SMTP Host (default: smtp.mandrillapp.com).  | SMTP   |\n| MANDRILL_SMTP_PORT        | Mandrill SMTP Port (default: 587).                   | SMTP   |\n| MANDRILL_USERNAME         | Mandrill username.                                   | SMTP   |\n| MANDRILL_PASSWORD         | Mandrill password.                                   | SMTP   |\n\n### Config Service Configuration\n\nRead email sender configuration from AccelByte Config Service.\n\nExample initialization:\n```go\nemailSender, errEmailSender := emailsender.NewEmailSender(emailsender.ConfigServiceSource)\n```\n\n#### Environment Variables\n\n| Environment Variable            | Description                                                                                                 |\n|---------------------------------|-------------------------------------------------------------------------------------------------------------|\n| APP_CONFIG_SERVICE_REMOTE_HOST  | Config Service host to fetch the email sender configuration (default: http://justice-config-service/config) |\n| APP_CONFIG_SERVICE_CACHE_EXPIRE | Config Service cache expire in second (default: 60)                                                         |\n| APP_EMAIL_SENDER_CACHE_EXPIRE   | Email sender platform cache expire in second (default: 60)                                                  |\n\n\n## License\n\nCopyright © 2023, AccelByte Inc. Released under the Apache License, Version 2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccelbyte%2Fjustice-go-common-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faccelbyte%2Fjustice-go-common-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccelbyte%2Fjustice-go-common-email/lists"}