{"id":17826432,"url":"https://github.com/fluke/google-http-actionmailer","last_synced_at":"2025-03-29T11:30:56.564Z","repository":{"id":49508199,"uuid":"129835552","full_name":"fluke/google-http-actionmailer","owner":"fluke","description":"Google HTTP API support for Actionmailer","archived":false,"fork":false,"pushed_at":"2021-06-16T08:31:18.000Z","size":16,"stargazers_count":15,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T04:21:19.683Z","etag":null,"topics":["actionmailer","gmail-api","google-api","rails"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/fluke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-17T02:40:30.000Z","updated_at":"2024-03-23T19:05:05.000Z","dependencies_parsed_at":"2022-08-20T22:00:35.785Z","dependency_job_id":null,"html_url":"https://github.com/fluke/google-http-actionmailer","commit_stats":null,"previous_names":["kartikluke/google-http-actionmailer"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluke%2Fgoogle-http-actionmailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluke%2Fgoogle-http-actionmailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluke%2Fgoogle-http-actionmailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluke%2Fgoogle-http-actionmailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluke","download_url":"https://codeload.github.com/fluke/google-http-actionmailer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246178329,"owners_count":20736125,"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":["actionmailer","gmail-api","google-api","rails"],"created_at":"2024-10-27T18:47:52.062Z","updated_at":"2025-03-29T11:30:56.173Z","avatar_url":"https://github.com/fluke.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoogleHttpActionmailer\n\nAn ActionMailer adapter to send email using Google's HTTPS Web API (instead of SMTP).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'google-http-actionmailer'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install google-http-actionmailer\n\n## Usage\n\nSet up your `authorization` as described in the [Google API Client](https://github.com/google/google-api-ruby-client/#authorization) (the easiest method is to pass a valid access token), edit `config/application.rb` or `config/environments/$ENVIRONMENT.rb` and add/change the following to the ActionMailer configuration:\n\n```ruby\nconfig.action_mailer.delivery_method = :google_http_actionmailer\n\nconfig.action_mailer.google_http_actionmailer_settings = {\n  authorization: ...,\n  client_options: {\n    application_name: ...,\n    application_version: ...,\n  },\n  request_options: {\n    retries: ...,\n    header: ...,\n  },\n  message_options: {\n    fields: ...,\n    content_type: ...,\n  },\n  delivery_options: {\n    before_send: ...,\n    after_send: ...,\n  }\n}\n```\n\n### Options\n\n| option | details |\n| ------ | ------- |\n| authorization | This is the authorization, it could be a access token, etc as described in the [Google API Client](https://github.com/google/google-api-ruby-client/#authorization) |\n| client_options | General client options as described in the [Google API Client options code](https://github.com/googleapis/google-api-ruby-client/blob/0.26.0/lib/google/apis/options.rb#L38). |\n| request_options | General request options as described in the [Google API Client options code](https://github.com/googleapis/google-api-ruby-client/blob/0.26.0/lib/google/apis/options.rb#L62). |\n| message_options | [Specific options](https://github.com/googleapis/google-api-ruby-client/blob/0.26.0/generated/google/apis/gmail_v1/service.rb#L1075) for that message such as fields, content_type, upload_source and quota_user. |\n| delivery_options | This currently contains hooks for before the message is sent and after the message is sent. |\n\nFor client and request options, you can look [here](https://github.com/google/google-api-ruby-client/blob/master/lib/google/apis/options.rb). And for message options, you can look at the `send_user_message` method [here](https://github.com/google/google-api-ruby-client/blob/master/generated/google/apis/gmail_v1/service.rb#L1150).\n\nFor dynamic setting of delivery method (this may be required given the access tokens usually expire):\n\n```ruby\nmail.delivery_method(\n  GoogleHttpActionmailer::DeliveryMethod, {\n  authorization: ...\n})\n```\n\nNormal ActionMailer usage will now transparently be sent using Google's HTTPS API.\n\nTo use the delivery options pass a proc that takes two parameters mail (the object created by ActionMailer) and message (the object created by the Gmail API).\n\n```ruby\nGoogleHttpActionmailer::DeliveryMethod, {\n  authorization: access_token,\n  client_options: {\n    application_name: ...,\n    application_version: ...,\n  },\n  delivery_options: {\n    after_send: -\u003e(mail, message) {\n      StorePostSendDetails.call(user: self, mail: mail, message: message)\n    },\n    before_send: -\u003e(mail, message) {\n      StorePreSendDetails.call(user: self, mail: mail, message: message)\n    }\n  }\n}\n```\n\nIf you want to set the threadId to your outgoing mail, just add the header 'Thread-ID' with the appropriate value.\n\n```ruby\nmail to: email, subject: subject, \"Thread-ID\": thread_id\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/google_http_actionmailer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the GoogleHttpActionmailer project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/google_http_actionmailer/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluke%2Fgoogle-http-actionmailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluke%2Fgoogle-http-actionmailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluke%2Fgoogle-http-actionmailer/lists"}