{"id":15685278,"url":"https://github.com/paganotoni/sendgrid-sender","last_synced_at":"2025-05-07T16:54:38.685Z","repository":{"id":57480464,"uuid":"147708989","full_name":"paganotoni/sendgrid-sender","owner":"paganotoni","description":"Buffalo's sender implementation for Sendgrid in Go","archived":false,"fork":false,"pushed_at":"2021-10-07T13:51:20.000Z","size":73,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T12:04:43.975Z","etag":null,"topics":["email","gobuffalo","golang","sender","sendgrid"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paganotoni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-06T17:25:28.000Z","updated_at":"2025-02-06T04:53:58.000Z","dependencies_parsed_at":"2022-09-26T17:41:42.116Z","dependency_job_id":null,"html_url":"https://github.com/paganotoni/sendgrid-sender","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paganotoni%2Fsendgrid-sender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paganotoni%2Fsendgrid-sender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paganotoni%2Fsendgrid-sender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paganotoni%2Fsendgrid-sender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paganotoni","download_url":"https://codeload.github.com/paganotoni/sendgrid-sender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252921953,"owners_count":21825632,"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":["email","gobuffalo","golang","sender","sendgrid"],"created_at":"2024-10-03T17:24:34.003Z","updated_at":"2025-05-07T16:54:38.661Z","avatar_url":"https://github.com/paganotoni.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Sendgrid Buffalo Sender\n\nThis is a [buffalo](https://github.com/gobuffalo/buffalo) sender for the [Sendgrid](https://sendgrid.com) email service.\n\n#### How to use\n\nIn your `mailers.go`\n\n```go\nimport (\n    ... \n    ssender \"github.com/paganotoni/sendgrid-sender\"\n)\n\nvar sender mail.Sender\n\nfunc init() {\n\tAPIKey := envy.Get(\"SENDGRID_API_KEY\", \"\")\n\tsender = ssender.NewSendgridSender(APIKey)\n}\n```\n\nAnd then in your mailers you would do the same `sender.Send(m)` as this sender matches buffalos [`mail.Sender`](https://github.com/gobuffalo/buffalo/blob/master/mail/mail.go#L4) interface.\n\n#### Add Custom Args\n\nTo add custom args, you must add values using `CustomArgs` type and add it into Message.Data ussing `CustomArgsKey` key\n\n```go\nCustomArgsKey = \"sendgrid_custom_args_key\"\n...\ntype CustomArgs map[string]string\n```\n\n#### How to use Sendgrid customargs\n\nOne thing you could need is to add customArgs to the message you're sending through sendgrid, to do this you would be using `SetCustomArgs` function, passing your `mail.Message`with the `CustomArgs` you want to add.\n\n```go\nimport (\n\t...\n    ssender \"github.com/paganotoni/sendgrid-sender\"\n)\n\nfunc main() {\n\tAPIKey := envy.Get(\"SENDGRID_API_KEY\", \"\")\n    sender = ssender.NewSendgridSender(APIKey)\n\n\tm := mail.NewMessage()\n    ...\n    ssender.SetCustomArgs(m, ssender.CustomArgs{\n        \"custom_arg_0\": \"custom_value_0\",\n        \"custom_arg_1\": \"custom_value_1\",\n        ...\n    })\n\n    if err := sender.Send(m); err != nil{\n        ...\n    }\n}\n```\n\n#### Test mode\n\nWhenever the GO_ENV variable is set to be `test` this sender will use [mocksmtp](https://github.com/stanislas-m/mocksmtp) sender to send messages, you can read values in your tests within the property `TestSender` of the SendgridSender.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaganotoni%2Fsendgrid-sender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaganotoni%2Fsendgrid-sender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaganotoni%2Fsendgrid-sender/lists"}