{"id":13878944,"url":"https://github.com/mailpace/mailpace-rails","last_synced_at":"2025-04-05T15:04:34.700Z","repository":{"id":40014803,"uuid":"294380212","full_name":"mailpace/mailpace-rails","owner":"mailpace","description":"A plugin for ActionMailer to send emails via MailPace.com","archived":false,"fork":false,"pushed_at":"2025-01-22T17:11:47.000Z","size":108,"stargazers_count":45,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T14:06:09.314Z","etag":null,"topics":["email","smtp-client","smtp-mail","smtp-server","transactional-emails"],"latest_commit_sha":null,"homepage":"https://mailpace.com","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/mailpace.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-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":"2020-09-10T10:40:48.000Z","updated_at":"2025-03-13T00:13:31.000Z","dependencies_parsed_at":"2025-01-22T18:32:02.637Z","dependency_job_id":null,"html_url":"https://github.com/mailpace/mailpace-rails","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailpace%2Fmailpace-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailpace%2Fmailpace-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailpace%2Fmailpace-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailpace%2Fmailpace-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mailpace","download_url":"https://codeload.github.com/mailpace/mailpace-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353729,"owners_count":20925329,"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","smtp-client","smtp-mail","smtp-server","transactional-emails"],"created_at":"2024-08-06T08:02:04.930Z","updated_at":"2025-04-05T15:04:34.674Z","avatar_url":"https://github.com/mailpace.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# MailPace::Rails\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Gem Version](https://badge.fury.io/rb/mailpace-rails.svg)](https://badge.fury.io/rb/mailpace-rails)\n[![MailPace Rails](https://circleci.com/gh/mailpace/mailpace-rails.svg?style=svg)](https://app.circleci.com/pipelines/github/mailpace/mailpace-rails)\n\n[MailPace](https://mailpace.com) lets you send transactional emails from your app over an easy to use API.\n\nThe MailPace Rails Gem is a plug in for ActionMailer to send emails via [MailPace](https://mailpace.com) to make sending emails from Rails apps super simple.\n\n\u003e **New in 0.4.0: [Idempotent Requests](https://docs.mailpace.com/guide/idempotency/), Improved Error Handling, InReplyTo and References support**\n\n\u003e **New in 0.3.0: The ability to consume [inbound emails](https://docs.mailpace.com/guide/inbound/) from MailPace via ActionMailbox**\n\n##  Usage\n\nOnce installed and configured, continue to send emails using [ActionMailer](https://guides.rubyonrails.org/action_mailer_basics.html) and receive emails with [ActionMailbox](https://edgeguides.rubyonrails.org/action_mailbox_basics.html) like normal.\n\n## Other Requirements\n\nYou will need an MailPace account with a verified domain and organization with an active plan.\n\n## Installation\n\n### Account Setup \n\nSet up an account at [MailPace](https://app.mailpace.com/users/sign_up) and complete the Onboarding steps\n\n### Gem Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'mailpace-rails'\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n```bash\n$ gem install mailpace-rails\n```\n\n### Configure the Gem\n\nFirst you will need to retrieve your API token for your sending domain from [MailPace](https://app.mailpace.com). You can find it under Organization -\u003e Domain -\u003e API Tokens.\n\nUse the encrypted secret management to save your API Token to `config/credentials.yml.enc` by running the following:\n\n```bash\nrails secret\nrails credentials:edit\n```\n\nThen add your token:\n\n```yaml\nmailpace_api_token: \"TOKEN_GOES_HERE\"\n```\n\nSet MailPace as your mail delivery method in `config/application.rb`:\n\n```ruby\nconfig.action_mailer.delivery_method = :mailpace\nconfig.action_mailer.mailpace_settings = { api_token: Rails.application.credentials.mailpace_api_token }\n```\n\n## Tagging\n\nYou can tag messages and filter them later in the MailPace UI. To do this, pass the tags as a header by adding a tag variable to your `mail` method call.\n\n```ruby\nclass TestMailer \u003c ApplicationMailer\n  default from: 'notifications@example.com',\n          to: 'fake@sdfasdfsdaf.com'\n\n  def single_tag\n    mail(\n      tags: 'test tag' # One tag\n    )\n  end\n\n  def multi_tag\n    mail(\n      tags: \"['test tag', 'another-tag']\" # Multiple tags\n    )\n  end\nend\n```\n\nNote that this should always be a string, even if using an array of multiple tags.\n\n## List-Unsubscribe\n\nTo add a List-Unsubscribe header, pass a `list_unsubscribe` string to the `mail` function:\n\n```ruby\nclass TestMailer \u003c ApplicationMailer\n  default from: 'notifications@example.com',\n          to: 'fake@sdfasdfsdaf.com'\n\n  def list_unsub_header\n    mail(\n      list_unsubscribe: 'https://listunsublink.com'\n    )\n  end\nend\n```\n\n## ActionMailbox (for receiving inbound emails)\n\nAs of v0.3.0, this Gem supports handling Inbound Emails (see https://docs.mailpace.com/guide/inbound/ for more details) via ActionMailbox. To set this up:\n\n1. Tell Action Mailbox to accept emails from MailPace in `config/environments/production.rb`\n\n```ruby\nconfig.action_mailbox.ingress = :mailpace\n```\n\n2. Generate a strong password that Action Mailbox can use to authenticate requests to the MailPace ingress.\nUse `bin/rails credentials:edit` to add the password to your application's encrypted credentials under `action_mailbox.ingress_password`, where Action Mailbox will automatically find it:\n\n```yaml\naction_mailbox:\n  ingress_password: ...\n```\n\nAlternatively, provide the password in the `RAILS_INBOUND_EMAIL_PASSWORD` environment variable.\n\n3. Configure MailPace to forward inbound emails to `/rails/action_mailbox/mailpace/inbound_emails` with the username `actionmailbox` and the password you previously generated. If your application lived at `https://example.com` you would configure your MailPace inbound endpoint URL with the following fully-qualified URL:\n\n`https://actionmailbox:PASSWORD@example.com/rails/action_mailbox/mailpace/inbound_emails`\n\nThat's it! Emails should start flowing into your app just like magic.\n\n## Idempotent Requests\n\nMailpace supports [idempotency](https://docs.mailpace.com/guide/idempotency) for safely retrying requests without accidentally sending the same email twice. This is useful to guarantee that an email is not sent to the same recipient multiple times, e.g. through a network error, or a bug in your application logic.\n\nTo do this, when writing your mailer, generate and add a unique `idempotency_key`:\n\n```ruby\nclass TestMailer \u003c ApplicationMailer\n  default from: 'notifications@example.com'\n  def idempotent_mail\n    email = 'email@example.com'\n    mail(\n      to: email,\n      idempotency_key: Digest::SHA256.hexdigest(\"#{email}-#{Time.now.to_i / 3600}\")\n    )\n  end\nend\n```\n\n## Support\n\nFor support please check the [MailPace Documentation](https://docs.mailpace.com)  or contact us at support@mailpace.com\n\n## Contributing\n\nPlease ensure to add a test for any change you make. To run the tests:\n\n`bin/test`\n\nPull requests always welcome\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailpace%2Fmailpace-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmailpace%2Fmailpace-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailpace%2Fmailpace-rails/lists"}