{"id":22662820,"url":"https://github.com/sendamply/amply-ruby","last_synced_at":"2025-07-08T08:33:02.933Z","repository":{"id":56842420,"uuid":"325057038","full_name":"sendamply/amply-ruby","owner":"sendamply","description":"Ruby SDK for Amply","archived":false,"fork":false,"pushed_at":"2020-12-28T23:44:09.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-09T18:17:02.694Z","etag":null,"topics":["amply","email","ruby","transactional-email"],"latest_commit_sha":null,"homepage":"","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/sendamply.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}},"created_at":"2020-12-28T16:11:00.000Z","updated_at":"2021-08-03T17:13:14.000Z","dependencies_parsed_at":"2022-08-29T12:51:07.906Z","dependency_job_id":null,"html_url":"https://github.com/sendamply/amply-ruby","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sendamply/amply-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendamply%2Famply-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendamply%2Famply-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendamply%2Famply-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendamply%2Famply-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sendamply","download_url":"https://codeload.github.com/sendamply/amply-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendamply%2Famply-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264231835,"owners_count":23576718,"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":["amply","email","ruby","transactional-email"],"created_at":"2024-12-09T12:15:43.521Z","updated_at":"2025-07-08T08:33:02.886Z","avatar_url":"https://github.com/sendamply.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amply\n\nThis is the Amply Ruby SDK that integrates with the [v1 API](https://docs.sendamply.com/docs/api/docs/Introduction.md).\n\n__Table of Contents__\n\n- [Install](#install)\n- [Quick Start](#quick-start)\n- [Classes](#classes)\n\t- [Email](#Email)\n\n## Install\n\n### Prerequisites\n- Ruby 2.4+\n- Amply account, [sign up here.](https://sendamply.com/plans)\n\n### Access Token\n\nObtain your access token from the [Amply UI.](https://sendamply.com/home/settings/access_tokens)\n\n### Install Package\n```\ngem install amply-ruby\n```\n\n### Domain Verification\nAdd domains you want to send `from` via the [Verified Domains](https://sendamply.com/home/settings/verified_domains) tab on your dashboard.\n\nAny emails you attempt to send from an unverified domain will be rejected.  Once verified, Amply immediately starts warming up your domain and IP reputation.  This warmup process will take approximately one week before maximal deliverability has been reached.\n\n## Quick Start\nThe following is the minimum needed code to send a simple email. Use this example, and modify the `to` and `from` variables:\n\n```ruby\nrequire 'amply'\n  \nAmply.set_access_token(ENV['AMPLY_ACCESS_TOKEN'])\n\nbegin\n  Amply::Email.create(to: 'test@example.com',\n                      from: 'test@verifieddomain.com',\n                      subject: 'My first Amply email!',\n                      text: 'This is easy',\n                      html: '\u003cstrong\u003eand fun :)\u003c/strong\u003e')\n\nrescue Amply::Exceptions::APIException =\u003e e\n  # Most likely invalid access token\n  puts e.status\n  puts e.text\nrescue Amply::Exceptions::ValidationException =\u003e e\n  puts e.message\n  puts e.errors\nend\n```\n\nOnce you execute this code, you should have an email in the inbox of the recipient.  You can check the status of your email in the UI from the [Search](https://sendamply.com/home/analytics/searches/basic/new), [SQL](https://sendamply.com/home/analytics/searches/sql/new), or [Users](https://sendamply.com/home/analytics/users) page.\n\n## Methods\n\n### email\n\nParameter(s)         | Description\n:---------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nto, cc, bcc | Email address of the recipient(s).  This may be a string `Test \u003ctest@example.com\u003e`, a hash `{ name: 'Test', email: 'test@example.com' }`, or an array of strings and hashes.\npersonalizations | For fine tuned access, you may override the to, cc, and bcc keys and use advanced personalizations.  See the API guide [here](https://docs.sendamply.com/docs/api/Mail-Send.v1.yaml/paths/~1email/post).\nfrom | Email address of the sender.  This may be formatted as a string or hash.  An array of senders is not allowed.\nsubject | Subject of the message.\nhtml | HTML portion of the message.\ntext | Text portion of the message.\ncontent | An array of hashes containing the following keys: `type` (required), `value` (required).\ntemplate | The template to use. This may be a string (the UUID of the template), an array of UUID's (useful for A/B/... testing where one is randomly selected), or a hash of the format `{ template1Uuid: 0.25, template2Uuid: 0.75 }` (useful for weighted A/B/... testing).\ndynamic_template_data | The dynamic data to be replaced in your template.  This is an hash of the format `{ variable1: 'replacement1', ... }`. Variables should be defined in your template body as `${variable1}`.\nreply_to |Email address of who should receive replies.  This may be a string or a hash with `name` and `email` keys.\nheaders | A hash where the header name is the key and header value is the value.\nip_or_pool_uuid | The UUID of the IP address or IP pool you want to send from.  Default is your Global pool.\nunsubscribe_group_uuid | The UUID of the unsubscribe group you want to associate with this email.\nattachments[][content] | A base64 encoded string of your attachment's content.\nattachments[][type] | The MIME type of your attachment.\nattachments[][filename] | The filename of your attachment.\nattachments[][disposition] | The disposition of your attachment (`inline` or `attachment`).\nattachments[][content_id] | The content ID of your attachment.\nclicktracking | Enable or disable clicktracking.\ncategories | An array of email categories you can associate with your message.\nsubstitutions | A hash of the format `{ sub_from: 'sub_to', ...}` of substitutions.\n\n__Example__\n\n```ruby\nAmply::Email.create(to:   'example@test.com',\n                    from: 'From \u003cexample@verifieddomain.com\u003e',\n                    text: 'Text part',\n                    html: 'HTML part',\n                    personalizations: [{ to: [{ name: 'Override To', email: 'test@example.com' }] }],\n                    content: [{ type: 'text/testing', value: 'some custom content type' }],\n                    subject: 'A new email!',\n                    reply_to: 'Reply To \u003ctest@example.com\u003e',\n                    template: 'faecb75b-371e-4062-89d5-372b8ff0effd',\n                    dynamic_template_data: { name: 'Jimmy' },\n                    unsubscribe_group_uuid: '5ac48b43-6e7e-4c51-817d-f81ea0a09816',\n                    ip_or_pool_uuid: '2e378fc9-3e23-4853-bccb-2990fda83ca9',\n                    attachments: [{'content': 'dGVzdA==', 'filename': 'test.txt', 'type': 'text/plain', 'disposition': 'inline'}],\n                    headers: {'X-Testing': 'Test'},\n                    categories: ['Test'],\n                    clicktracking: true,\n                    substitutions: { sub1: 'replacement1' })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsendamply%2Famply-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsendamply%2Famply-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsendamply%2Famply-ruby/lists"}