{"id":29251719,"url":"https://github.com/macrat/new-year-sender","last_synced_at":"2025-07-04T01:08:15.894Z","repository":{"id":104355905,"uuid":"115704616","full_name":"macrat/new-year-sender","owner":"macrat","description":"The email sender for my new year email.","archived":false,"fork":false,"pushed_at":"2023-12-30T12:13:16.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T17:57:42.670Z","etag":null,"topics":[],"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/macrat.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}},"created_at":"2017-12-29T08:41:11.000Z","updated_at":"2023-12-30T12:13:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8043e65-ca6a-430c-9053-c7ce8ecbe925","html_url":"https://github.com/macrat/new-year-sender","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/macrat/new-year-sender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fnew-year-sender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fnew-year-sender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fnew-year-sender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fnew-year-sender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macrat","download_url":"https://codeload.github.com/macrat/new-year-sender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fnew-year-sender/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263427316,"owners_count":23464845,"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":[],"created_at":"2025-07-04T01:08:15.356Z","updated_at":"2025-07-04T01:08:15.848Z","avatar_url":"https://github.com/macrat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"new-year-sender\n===============\n\nThe email sender for new year email.\n\n## Simple usage\nInstall new-year-sender,\n\n``` shell\n$ go get github.com/macrat/new-year-sender\n```\n\nMake source file like this,\n\n``` yaml\napikey: your-API-key-of-SendGrid\n\nfrom: your name \u003cyour-email@example.com\u003e\n\nto:\n  - name \u003cdestination-email@example.com\u003e\n\ndate: 2018-01-01 00:00  # the date to send email.\n\ntitle: E-Mail subject\n\ntext: |\n  contents of an email.\n\n  this is test\n\nhtml: |\n  \u003cp\u003econtents of an \u003cb\u003eemail\u003c/b\u003e.\u003c/p\u003e\n\n  \u003cp\u003ethis is test\u003c/p\u003e\n\nattach:\n  - path/to/file.ext\n```\n\nAnd send it.\n\n``` shell\n$ new-year-sender --source source-file.yml\n```\n\n## Send many emails\nYou can send many emails with the simple source file.\nThis behavior is like an object-based programming.\n\nfor example:\n\n``` yaml\napikey: your-API-key-of-SendGrid\n\n# common settings\nfrom: your name \u003cyour-email@example.com\u003e\n\ndate: 2018-01-01 00:00\n\ntitle: hello\n\ntext: |\n  hello!\n  this is test e-mail!!\n\nattach:\n  - attached-file.png\n\n# personal settings\nmails:\n  - title: hello alice  # override title\n    to:\n      - alice \u003calice@example.com\u003e\n\n  - attach:   # append attach\n      - attached-file2.png\n\n    to:\n      - bob@example.com\n\n  # more extend\n  - date: 2018-01-01 10:00\n\n    mails:\n      - to:\n          - charie@example.com\n          - dave@example.com\n        cc:\n          - charie2@example.com\n\n      - to:\n        - eve \u003ceve@example.com\u003e\n```\n\nThis source will send 4 emails.\n\nIf you want test source, please use `--test` or `--dryrun` option.\n`--test` option will validate source and display errors if that exists.\n`--dryrun` option will execute `--test` and display parsed results.\nWon't send emails if enabled either option.\n\nPrint like this when given the above source file with `--dryrun` option.\n\n``` shell\n$ new-year-sender --test \u003c test.yml\ntitle:  hello alice\nfrom:  your name \u003cyour-email@example.com\u003e\nto: [\"alice\" \u003calice@example.com\u003e]\ncc: []\nbcc: []\ndate:  2018-01-01 00:00:00 +0900 JST\nAttached: attached-file.png\n\nhello!\nthis is test e-mail!!\n\n==============================\ntitle:  hello\nfrom:  your name \u003cyour-email@example.com\u003e\nto: [\u003cbob@example.com\u003e]\ncc: []\nbcc: []\ndate:  2018-01-01 00:00:00 +0900 JST\nAttached: attached-file2.png, attached-file.png\n\nhello!\nthis is test e-mail!!\n\n==============================\ntitle:  hello\nfrom:  your name \u003cyour-email@example.com\u003e\nto: [\u003ccharie@example.com\u003e, \u003cdave@example.com\u003e]\ncc: [\u003ccharie2@example.com\u003e]\nbcc: []\ndate:  2018-01-01 10:00:00 +0900 JST\nAttached: attached-file.png\n\nhello!\nthis is test e-mail!!\n\n==============================\ntitle:  hello\nfrom:  your name \u003cyour-email@example.com\u003e\nto: [\"eve\" \u003ceve@example.com\u003e]\ncc: []\nbcc: []\ndate:  2018-01-01 10:00:00 +0900 JST\nAttached: attached-file.png\n\nhello!\nthis is test e-mail!!\n```\n\n## Apply templates\nSender supports template for text and HTML body.\n\nfor example:\n\n``` yaml\napikey: your-API-key-of-SendGrid\n\ntitle: Template example\n\nfrom: your name \u003cyour-email@example.com\u003e\n\ntext_template: |\n  Hello!\n\n  {{.Text}}\n\n  Best regards,\n\nhtml_template: |\n  \u003cbody style=\"background-color: #f0f0f0; color: #000;\"\u003e\n    \u003cp\u003eHello!\u003c/p\u003e\n    {{.Html}}\n    \u003cp\u003eBest regards,\u003c/p\u003e\n  \u003c/body\u003e\n\nmails:\n  - to: [alice \u003calice@example.com\u003e]\n    text:\n      How are you alice?\n    html:\n      \u003cp\u003eHow are you \u003cb\u003ealice\u003c/b\u003e?\u003c/p\u003e\n\n  - to: [bob \u003cbob@example.com\u003e]\n    text:\n      booooooooob\n    html:\n      \u003cp style=\"font-size:500%\"\u003ebooooooob\u003c/p\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacrat%2Fnew-year-sender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacrat%2Fnew-year-sender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacrat%2Fnew-year-sender/lists"}