{"id":17204940,"url":"https://github.com/blackhole1/sesmate","last_synced_at":"2025-05-07T23:29:52.796Z","repository":{"id":147938423,"uuid":"617811166","full_name":"BlackHole1/sesmate","owner":"BlackHole1","description":"Friendly AWS SES assistant, to better maintain SES templates in your project and support local mock SES server","archived":false,"fork":false,"pushed_at":"2024-05-11T08:54:14.000Z","size":229,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T01:11:45.072Z","etag":null,"topics":["aws","aws-ses","mock-aws","mock-ses","ses","sesv2"],"latest_commit_sha":null,"homepage":"","language":"Go","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/BlackHole1.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":"2023-03-23T06:48:16.000Z","updated_at":"2024-10-16T02:24:12.000Z","dependencies_parsed_at":"2023-05-28T01:30:41.334Z","dependency_job_id":null,"html_url":"https://github.com/BlackHole1/sesmate","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackHole1%2Fsesmate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackHole1%2Fsesmate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackHole1%2Fsesmate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackHole1%2Fsesmate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlackHole1","download_url":"https://codeload.github.com/BlackHole1/sesmate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243663516,"owners_count":20327300,"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":["aws","aws-ses","mock-aws","mock-ses","ses","sesv2"],"created_at":"2024-10-15T02:23:44.316Z","updated_at":"2025-03-14T23:31:58.612Z","avatar_url":"https://github.com/BlackHole1.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SESMATE\n\n## Install\n\n```shell\ncurl -fsSL https://raw.githubusercontent.com/BlackHole1/sesmate/main/install.sh | sh -\n# or\nwget -qO- https://raw.githubusercontent.com/BlackHole1/sesmate/main/install.sh | sh -\n```\n\n## sync\n\nSynchronize local templates to AWS SES service, supporting create, delete, and update operations.\n\n\u003e AWS SES Template Structure: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html#send-personalized-email-create-template\n\n### Command Line Options\n\n- `--dir` - The local template directory.\n- `--remove` - Delete remote template when it is not found locally.\n- `--ak` - The AWS access key.\n- `--sk` - The AWS secret key.\n- `--endpoint` - The AWS endpoint.\n- `--region` - The AWS region.\n- `--help` - Print usage help.\n\n### Usage\n\n#### GitHub Action\n\n```yaml\nname: \"Sync SES Template\"\non:\n  push:\n    branches:\n      - main\n    paths:\n      - sestemplate/**.json\n\n  workflow_dispatch:\n    inputs:\n      tags:\n        required: false\n        description: \"\"\n\njobs:\n  sync:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: Install sesmate\n        run: |\n          sudo curl -fsSL -o /usr/local/bin/sesmate https://github.com/BlackHole1/sesmate/releases/latest/download/sesmate-linux-amd64\n          sudo chmod +x /usr/local/bin/sesmate\n\n      - name: Run Sync\n        run: sesmate sync --dir ./sestemplate --remove\n        env:\n          AWS_AK: ${{ secrets.AWS_AK }}\n          AWS_SK: ${{ secrets.AWS_SK }}\n          AWS_REGION: ${{ secrets.AWS_REGION }}\n```\n\nor\n\n```yaml\n# ...\n- name: Configure AWS Credentials\n  uses: aws-actions/configure-aws-credentials@v1\n  with:\n    aws-region: ${{ secrets.AWS_REGION }}\n    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n    aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n    role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}\n    role-duration-seconds: 120\n    role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}\n# ...\n- name: Run Sync\n  run: sesmate sync --dir ./sestemplate --remove\n```\n\n#### Use aws credentials\n\n```shell\nsesmate sync --dir ./sestemplate\n```\n\n#### Use aws profile\n\n```shell\nAWS_PROFILE=dev sync --dir ./sestemplate\n```\n\n#### Use aws access key and secret key and region\n\n```shell\nsesmate sync --dir ./sestemplate --ak AKIAIOSFODNN7EXAMPLE --sk wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY --region us-east-1\n```\n\n#### Custom endpoint\n\n```shell\nsesmate sync --dir ./sestemplate --endpoint http://localhost:4579\n```\n\n#### Use environment variables\n\n```shell\nexport AWS_AK=AKIAIOSFODNN7EXAMPLE\nexport AWS_SK=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\nexport AWS_ENDPOINT=http://localhost:4579\nexport AWS_REGION=us-east-1\nsesmate sync --dir ./sestemplate\n```\n\n## gen\n\nGenerate go file from template files.\n\n### Command Line Options\n\n- `--dir` - Local template directory.\n- `--output` - Output directory. Default: \"./sestemplate\".\n- `--filename` - Output file name. Default: \"name\".\n- `--package-name` - GO package name. Default: \"sestemplate\".\n- `--prefix` - Prefix of generated const. Default: \"\".\n- `--case` - Case of generated const, allowed values: *lower*, *upper*, *camel*, *pascal*, *snake*, *screaming_snake*, *capitalized_snake*. Default: \"pascal\".\n- `--help` - Print usage help.\n\n### Usage\n\n```shell\nsesmate gen --dir ./sestemplate --output ./sestemplate --filename name --package-name sestemplate --prefix Name --case pascal\n```\n\n## Example\n\n./sestemplate/a.json:\n```json\n{\n    \"Template\": {\n        \"TemplateName\": \"v1_user_info\",\n        \"SubjectPart\": \"Your Info\",\n        \"TextPart\": \"Name: {{name}}, age: {{ Age }}, email: {{_email}}, nickname: {{_name}}\"\n    }\n}\n```\n\nexecute:\n```shell\nsesmate gen --dir ./sestemplate --output ./sestemplate --filename name --package-name sestemplate --case pascal\n```\n\noutput file: ./sestemplate/name.go:\n```go\npackage sestemplate\n\nconst V1UserInfo = \"v1_user_info\"\n\ntype V1UserInfoData struct {\n\tName  string `json:\"name\"`\n\tAge   int    `json:\"Age\"`\n\tEmail string `json:\"_email\"`\n\tName2 string `json:\"_name\"`\n}\n```\n\n## server\n\nStart a local SES server.\n\n* Support sesv2\n* Support `SendEmail` API in AWS\n\n### Command Line Options\n\n- `--dir` - The local template directory.\n- `--port` - The port to listen on. Default: \"8091\".\n- `--host` - The host to listen on. Default: \"127.0.0.1\".\n- `--help` - Print usage help.\n\n### Usage\n\n```shell\nsesmate server --dir ./sestemplate --port 8091 --host 127.0.0.1\n```\n\n\u003e AWS Endpoint is: `http://localhost:8091/aws`\n\n\u003e Open `http://localhost:8091/` in browser to view the email list.\n\n![](./asserts/server-web.png)\n\n## zsh completion\n```shell\necho \"source \u003c(sesmate completion zsh); compdef _sesmate sesmate\" \u003e\u003e ~/.zshrc\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackhole1%2Fsesmate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackhole1%2Fsesmate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackhole1%2Fsesmate/lists"}