{"id":19078347,"url":"https://github.com/kickstarter/mail-x_smtpapi","last_synced_at":"2025-04-06T23:17:11.220Z","repository":{"id":24344122,"uuid":"27741958","full_name":"kickstarter/mail-x_smtpapi","owner":"kickstarter","description":"Adds SendGrid X-SMTPAPI header support to Mail","archived":false,"fork":false,"pushed_at":"2024-12-16T15:40:20.000Z","size":29,"stargazers_count":22,"open_issues_count":2,"forks_count":6,"subscribers_count":122,"default_branch":"main","last_synced_at":"2025-03-30T21:11:18.321Z","etag":null,"topics":[],"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/kickstarter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2014-12-09T00:27:06.000Z","updated_at":"2024-12-16T15:40:24.000Z","dependencies_parsed_at":"2025-01-15T17:34:19.693Z","dependency_job_id":"978f41f6-5207-4db7-b2b0-72a9beb435c2","html_url":"https://github.com/kickstarter/mail-x_smtpapi","commit_stats":{"total_commits":26,"total_committers":4,"mean_commits":6.5,"dds":0.1923076923076923,"last_synced_commit":"9aaa5d68c2f48099efbc71e63e1a19c18549a34e"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fmail-x_smtpapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fmail-x_smtpapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fmail-x_smtpapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fmail-x_smtpapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kickstarter","download_url":"https://codeload.github.com/kickstarter/mail-x_smtpapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247563937,"owners_count":20958971,"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":"2024-11-09T02:08:33.782Z","updated_at":"2025-04-06T23:17:11.202Z","avatar_url":"https://github.com/kickstarter.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mail::X::Smtpapi\n\n[![Gem Version](https://badge.fury.io/rb/mail-x_smtpapi.svg)](http://badge.fury.io/rb/mail-x_smtpapi) [![Circle CI](https://img.shields.io/circleci/project/kickstarter/mail-x_smtpapi.svg?style=shield)](https://circleci.com/gh/kickstarter/mail-x_smtpapi/tree/master) [![Code Climate](https://codeclimate.com/github/kickstarter/mail-x_smtpapi/badges/gpa.svg)](https://codeclimate.com/github/kickstarter/mail-x_smtpapi)\n\nIntegrates support for SendGrid's X-SMTPAPI field into the [Mail](https://github.com/mikel/mail) gem.\n\nPlease refer to [SendGrid docs](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html) for ideas of what you can do with the X-SMTPAPI header!\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'mail-x_smtpapi'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install mail-x_smtpapi\n\n## Usage\n\nWrite into the X-SMTPAPI header from anywhere with access to the `mail` object.\n\n### Example: Rails Mailer\n\nAdapting the [Rails Guide example](http://guides.rubyonrails.org/v4.0.8/action_mailer_basics.html#edit-the-mailer):\n\n```ruby\nclass UserMailer \u003c ActionMailer::Base\n\n  def welcome(user)\n    @user = user\n\n    mail.smtpapi.category = 'welcome'\n    mail.smtpapi.unique_args['user_id'] = @user.id\n\n    mail(to: @user.email, subject: 'Welcome to My Awesome Site')\n  end\n\nend\n```\n\n### Example: Mail Interceptor\n\nAdapting the [Rails Guide example](http://guides.rubyonrails.org/v4.0.8/action_mailer_basics.html#intercepting-emails):\n\n```ruby\nclass SandboxEmailInterceptor\n  def self.delivering_email(message)\n    message.smtpapi.unique_args['original'] = message.to\n    message.to = ['sandbox@example.com']\n  end\nend\n```\n\n### Example: Template Helper\n\n```ruby\nmodule MailerABHelper\n  def show_variant?(name)\n    variant = rand(2) == 0 ? 'main' : 'alternate'\n    mail.smtpapi.unique_args[\"#{name}_variant\"] = variant\n    return variant == 'alternate'\n  end\nend\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/kickstarter/mail-x_smtpapi/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkickstarter%2Fmail-x_smtpapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkickstarter%2Fmail-x_smtpapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkickstarter%2Fmail-x_smtpapi/lists"}