# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['mailersend',
 'mailersend.activity',
 'mailersend.analytics',
 'mailersend.base',
 'mailersend.domains',
 'mailersend.emails',
 'mailersend.inbound_routing',
 'mailersend.messages',
 'mailersend.recipients',
 'mailersend.scheduled_messages',
 'mailersend.sms_activity',
 'mailersend.sms_inbounds',
 'mailersend.sms_messages',
 'mailersend.sms_phone_numbers',
 'mailersend.sms_recipients',
 'mailersend.sms_sending',
 'mailersend.sms_webhooks',
 'mailersend.templates',
 'mailersend.tokens',
 'mailersend.utils',
 'mailersend.webhooks']

package_data = \
{'': ['*']}

install_requires = \
['pre-commit>=2.12.1,<3.0.0',
 'requests>=2.25.0,<3.0.0',
 'setuptools>=63.0.0,<64.0.0']

setup_kwargs = {
    'name': 'mailersend',
    'version': '0.3.8',
    'description': 'The official MailerSend Python SDK',
    'long_description': '<a href="https://www.mailersend.com"><img src="https://www.mailersend.com/images/logo.svg" width="200px"/></a>\n\nMailerSend Python SDK\n\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n# Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Email](#email)\n        - [Send an email](#send-an-email)\n        - [Add CC, BCC recipients](#add-cc-bcc-recipients)\n        - [Send a template-based email](#send-a-template-based-email)\n        - [Advanced personalization](#advanced-personalization)\n        - [Simple personalization](#simple-personalization)\n        - [Send email with attachment](#send-email-with-attachment)\n    - [Bulk Email](#bulk-email)\n        - [Send bulk email](#send-bulk-email)\n        - [Get bulk email status](#get-bulk-email-status)\n    - [Activity](#activity)\n        - [Get a list of activities (simple)](#get-a-list-of-activities-simple)\n        - [Get a list of activities (full)](#get-a-list-of-activities-full)\n    - [Analytics](#analytics)\n        - [Activity data by date](#activity-data-by-date)\n        - [Opens by country](#opens-by-country)\n        - [Opens by user-agent name](#opens-by-user-agent-name)\n        - [Opens by reading environment](#opens-by-reading-environment)\n    - [Inbound Routes](#inbound-routes)\n        - [Get a list of inbound routes](#get-a-list-of-inbound-routes)\n        - [Get a single inbound route](#get-a-single-inbound-route)\n        - [Add an inbound route](#add-an-inbound-route)\n        - [Update an inbound route](#update-an-inbound-route)\n        - [Delete an inbound route](#delete-an-inbound-route)\n    - [Domains](#domains)\n        - [Get a list of domains](#get-a-list-of-domains)\n        - [Get a single domain](#get-a-single-domain)\n        - [Get a single domain using helper function](#get-a-single-domain-using-helper-function)\n        - [Add a domain](#add-a-domain)\n        - [Delete a domain](#delete-a-domain)\n        - [Get a list of recipients per domain](#get-a-list-of-recipients-per-domain)\n        - [Update domain settings](#update-domain-settings)\n        - [Get dns records](#get-dns-records)\n        - [Verify a domain](#verify-a-domain)\n    - [Messages](#messages)\n        - [Get a list of messages](#get-a-list-of-messages)\n        - [Get a single message](#get-a-single-message)\n    - [Scheduled Messages](#scheduled-messages)\n        - [Get a list of scheduled messages](#get-a-list-of-scheduled-messages)\n        - [Get a single scheduled message](#get-a-single-scheduled-message)\n        - [Delete a scheduled message](#delete-a-scheduled-message)\n    - [Recipients](#recipients)\n        - [Get a list of recipients](#get-a-list-of-recipients)\n        - [Get a single recipient](#get-a-single-recipient)\n        - [Delete a recipient](#delete-a-recipient)\n        - [Get recipients from a blocklist](#get-recipients-from-a-blocklist)\n        - [Get recipients from hard bounces](#get-recipients-from-hard-bounces)\n        - [Get recipients from spam complaints](#get-recipients-from-spam-complaints)\n        - [Get recipients from unsubscribes](#get-recipients-from-unsubscribes)\n        - [Add recipients to blocklist](#add-recipients-to-blocklist)\n        - [Add hard bounced recipients](#add-hard-bounced-recipients)\n        - [Add spam complaints](#add-spam-complaints)\n        - [Add recipients to unsubscribe list](#add-recipients-to-unsubcribe-list)\n        - [Delete recipients from blocklist](#delete-recipients-from-blocklist)\n        - [Delete hard bounced recipients](#delete-hard-bounced-recipients)\n        - [Delete spam complaints](#delete-spam-complaints)\n        - [Delete recipients from unsubscribe list](#delete-recipients-from-unsubscribe-list)\n    - [SMS sending](#sms)\n        - [Sending SMS messages](#sending-sms-messages)\n    - [SMS Activity](#sms-activity)\n        - [Get a list of activities](#get-a-list-of-activities)\n        - [Get activity of a single message](#get-activity-of-a-single-message)\n    - [SMS Phone Numbers](#sms-phone-numbers)\n        - [Get a list of SMS phone numbers](#get-a-list-of-sms-phone-numbers)\n        - [Get an SMS phone number](#get-an-sms-phone-number)\n        - [Update a single SMS phone number](#update-a-single-sms-phone-number)\n        - [Delete an SMS phone number](#delete-an-sms-phone-number)\n    - [SMS Recipients](#sms-recipients)\n        - [Get a list of SMS recipients](#get-a-list-of-sms-recipients)\n        - [Get an SMS recipient](#get-an-sms-recipient)\n        - [Update a single SMS recipient](#update-a-single-sms-recipient)\n    - [SMS Messages](#sms-messages)\n        - [Get a list of SMS messages](#get-a-list-of-sms-messages)\n        - [Get an SMS message](#get-an-sms-message)\n    - [SMS Webhooks](#sms-webhooks)\n        - [Get a list of SMS webhooks](#get-a-list-of-sms-webhooks)\n        - [Get a single SMS webhook](#get-a-single-sms-webhook)\n        - [Create an SMS webhook](#create-an-sms-webhook)\n        - [Update a single SMS webhook](#update-a-single-sms-webhook)\n        - [Delete an SMS webhook](#delete-an-sms-webhook)\n    - [SMS Inbounds](#sms-inbouds)\n        - [Get a list of SMS Inbound routes](#get-a-list-of-inbound-routes)\n        - [Get a single SMS Inbound route](#get-a-single-inbound-route)\n        - [Create an SMS Inbound route](#add-an-inbound-route)\n        - [Update an SMS Inbound route](#update-an-inbound-route)\n        - [Delete an SMS Inbound route](#delete-an-inbound-route)\n    - [Tokens](#tokens)\n        - [Create a token](#create-a-token)\n        - [Pause / Unpause Token](#pause--unpause-token)\n        - [Delete a token](#delete-a-token)\n    - [Templates](#templates)\n        - [Get a list of templates](#get-a-list-of-templates)\n        - [Get a single template](#get-a-single-template)\n        - [Delete a template](#delete-template)\n    - [Webhooks](#webhooks)\n        - [Get a list of webhooks](#get-a-list-of-webhooks)\n        - [Get a single webhook](#get-a-single-webhook)\n        - [Create a webhook](#create-a-webhook)\n        - [Create a disabled webhook](#create-a-disabled-webhook)\n        - [Update a Webhook](#update-a-webhook)\n        - [Delete a Webhook](#delete-a-webhook)\n- [Troubleshooting](#troubleshooting)\n    - [Emails not being sent](#emails-not-being-sent)\n- [Testing](#testing)\n- [Support and Feedback](#support-and-feedback)\n- [License](#license)\n\n<a name="installation"></a>\n\n# Installation\n\n```\n$ python -m pip install mailersend\n```\n\n## Requirements\n\n- Python > 3.6.1\n- Python `pip`\n- An API Key from [mailersend.com](https://www.mailersend.com)\n\n## Authentication\n\nYou can use either the `MAILERSEND_API_KEY` environment variable or explicitly\nset a variable in-code.\n\n- Using environment variable\n```python\nfrom mailersend import emails\n\n# assigning NewEmail() without params defaults to MAILERSEND_API_KEY env var\nmailer = emails.NewEmail()\n\n# define an empty dict to populate with mail values\nmail_body = {}\n\nmail_from = {\n    "name": "Your Name",\n    "email": "your@domain.com",\n}\n\nrecipients = [\n    {\n        "name": "Your Client",\n        "email": "your@client.com",\n    }\n]\n\nreply_to = [\n    {\n        "name": "Name",\n        "email": "reply@domain.com",\n    }\n]\n\nmailer.set_mail_from(mail_from, mail_body)\nmailer.set_mail_to(recipients, mail_body)\nmailer.set_subject("Hello!", mail_body)\nmailer.set_html_content("This is the HTML content", mail_body)\nmailer.set_plaintext_content("This is the text content", mail_body)\nmailer.set_reply_to(reply_to, mail_body)\n\n# using print() will also return status code and data\nmailer.send(mail_body)\n```\n\n- Explicit declaration\n```python\nfrom mailersend import emails\n\napi_key = "API key here"\n\nmailer = emails.NewEmail(api_key)\n\n# define an empty dict to populate with mail values\nmail_body = {}\n\nmail_from = {\n    "name": "Your Name",\n    "email": "your@domain.com",\n}\n\nrecipients = [\n    {\n        "name": "Your Client",\n        "email": "your@client.com",\n    }\n]\n\nreply_to = [\n    {\n        "name": "Name",\n        "email": "reply@domain.com",\n    }\n]\n\nmailer.set_mail_from(mail_from, mail_body)\nmailer.set_mail_to(recipients, mail_body)\nmailer.set_subject("Hello!", mail_body)\nmailer.set_html_content("This is the HTML content", mail_body)\nmailer.set_plaintext_content("This is the text content", mail_body)\nmailer.set_reply_to(reply_to, mail_body)\n\n# using print() will also return status code and data\nmailer.send(mail_body)\n```\n\n# Usage\n\n## Email\n\n### Send an email\n\n```python\nfrom mailersend import emails\n\napi_key = "API key here"\n\nmailer = emails.NewEmail(api_key)\n\n# define an empty dict to populate with mail values\nmail_body = {}\n\nmail_from = {\n    "name": "Your Name",\n    "email": "your@domain.com",\n}\n\nrecipients = [\n    {\n        "name": "Your Client",\n        "email": "your@client.com",\n    }\n]\n\nreply_to = [\n    {\n        "name": "Name",\n        "email": "reply@domain.com",\n    }\n]\n\nmailer.set_mail_from(mail_from, mail_body)\nmailer.set_mail_to(recipients, mail_body)\nmailer.set_subject("Hello!", mail_body)\nmailer.set_html_content("This is the HTML content", mail_body)\nmailer.set_plaintext_content("This is the text content", mail_body)\nmailer.set_reply_to(reply_to, mail_body)\n\n# using print() will also return status code and data\nmailer.send(mail_body)\n```\n\n### Add CC, BCC recipients\n\n```python\nfrom mailersend import emails\n\napi_key = "API key here"\n\nmailer = emails.NewEmail(api_key)\n\n# define an empty dict to populate with mail values\nmail_body = {}\n\nmail_from = {\n    "name": "Your Name",\n    "email": "your@domain.com",\n}\n\nrecipients = [\n    {\n        "name": "Your Client",\n        "email": "your@client.com",\n    }\n]\n\ncc = [\n    {\n        "name": "CC",\n        "email": "cc@client.com"\n    }\n]\n\nbcc = [\n    {\n        "name": "BCC",\n        "email": "bcc@client.com"\n    }\n]\n\nmailer.set_mail_from(mail_from, mail_body)\nmailer.set_mail_to(recipients, mail_body)\nmailer.set_subject("Hello!", mail_body)\nmailer.set_html_content("This is the HTML content", mail_body)\nmailer.set_plaintext_content("This is the text content", mail_body)\nmailer.set_cc_recipients(cc, mail_body)\nmailer.set_bcc_recipients(bcc, mail_body)\n\nmailer.send(mail_body)\n```\n\n### Send a template-based email\n\n```python\nfrom mailersend import emails\n\napi_key = "API key here"\n\nmailer = emails.NewEmail(api_key)\n\n# define an empty dict to populate with mail values\nmail_body = {}\n\nmail_from = {\n    "name": "Your Name",\n    "email": "your@domain.com",\n}\n\nrecipients = [\n    {\n        "name": "Your Client",\n        "email": "your@client.com",\n    }\n]\n\n\nvariables = [\n    {\n        "email": "your@client.com",\n        "substitutions": [\n            {\n                "var": "foo",\n                "value": "bar"\n            },\n        ]\n    }\n]\n\n\nmailer.set_mail_from(mail_from, mail_body)\nmailer.set_mail_to(recipients, mail_body)\nmailer.set_subject("Hello from {$company}", mail_body)\nmailer.set_template("templateID", mail_body)\nmailer.set_simple_personalization(variables, mail_body)\n\nmailer.send(mail_body)\n```\n\n### Advanced personalization\n\n```python\nfrom mailersend import emails\n\napi_key = "API key here"\n\nmailer = emails.NewEmail(api_key)\n\n# define an empty dict to populate with mail values\nmail_body = {}\n\nmail_from = {\n    "name": "Your Name",\n    "email": "your@domain.com",\n}\n\nrecipients = [\n    {\n        "name": "Your Client",\n        "email": "your@client.com",\n    }\n]\n\npersonalization = [\n    {\n        "email": "test@mailersend.com",\n        "data": {\n            "var": "value",\n            "boolean": True,\n            "object": {\n                "key" : "object-value"\n            },\n            "number": 2,\n            "array": [\n                1,\n                2,\n                3\n            ]\n        }\n    }\n]\n\n\nmailer.set_mail_from(mail_from, mail_body)\nmailer.set_mail_to(recipients, mail_body)\nmailer.set_subject("Hello from {$company}", mail_body)\nmailer.set_html_content("This is the HTML content, {$name}", mail_body)\nmailer.set_plaintext_content("This is the text content, {$name}", mail_body)\nmailer.set_advanced_personalization(personalization, mail_body)\n\nmailer.send(mail_body)\n```\n\n### Simple personalization\n\n```python\nfrom mailersend import emails\n\napi_key = "API key here"\n\nmailer = emails.NewEmail(api_key)\n\n# define an empty dict to populate with mail values\nmail_body = {}\n\nmail_from = {\n    "name": "Your Name",\n    "email": "your@domain.com",\n}\n\nrecipients = [\n    {\n        "name": "Your Client",\n        "email": "your@client.com",\n    }\n]\n\nvariables = [\n    {\n        "email": "your@client.com",\n        "substitutions": [\n            {\n                "var": "foo",\n                "value": "bar"\n            },\n        ]\n    }\n]\n\n\nmailer.set_mail_from(mail_from, mail_body)\nmailer.set_mail_to(recipients, mail_body)\nmailer.set_subject("Hello from {$foo}", mail_body)\nmailer.set_html_content("This is the HTML content, {$foo}", mail_body)\nmailer.set_plaintext_content("This is the text content, {$foo}", mail_body)\nmailer.set_simple_personalization(variables, mail_body)\n\nmailer.send(mail_body)\n```\n\n### Send email with attachment\n\n```python\nfrom mailersend import emails\nimport base64\n\napi_key = "API key here"\n\nmailer = emails.NewEmail(api_key)\n\n# define an empty dict to populate with mail values\nmail_body = {}\n\nmail_from = {\n    "name": "Your Name",\n    "email": "your@domain.com",\n}\n\nrecipients = [\n    {\n        "name": "Your Client",\n        "email": "your@client.com",\n    }\n]\n\nvariables = [\n    {\n        "email": "your@client.com",\n        "substitutions": [\n            {\n                "var": "foo",\n                "value": "bar"\n            },\n        ]\n    }\n]\n\nattachment = open(\'path-to-file\', \'rb\')\natt_read = attachment.read()\natt_base64 = base64.b64encode(bytes(att_read))\nattachments = [\n    {\n        "id": "my-attached-file",\n        "filename": "file.jpg",\n        "content": f"{att_base64.decode(\'ascii\')}"\n    }\n]\n\nmailer.set_mail_from(mail_from, mail_body)\nmailer.set_mail_to(recipients, mail_body)\nmailer.set_subject("Hello from {$foo}", mail_body)\nmailer.set_html_content("This is the HTML content, {$foo}", mail_body)\nmailer.set_plaintext_content("This is the text content, {$foo}", mail_body)\nmailer.set_simple_personalization(variables, mail_body)\nmailer.set_attachments(attachments, mail_body)\n\nmailer.send(mail_body)\n```\n\n## Bulk Email\n\n### Send bulk email\n\n```python\nfrom mailersend import emails\n\napi_key = "API key here"\n\nmailer = mailersend.NewEmail(api_key)\n\nmail_list = [\n  {\n    "from": {\n      "email": "your@domain.com",\n      "name": "Your Name"\n    },\n    "to": [\n      {\n        "email": "your@client.com",\n        "name": "Your Client"\n      }\n    ],\n    "subject": "Subject",\n    "text": "This is the text content",\n    "html": "<p>This is the HTML content</p>",\n  },\n  {\n    "from": {\n      "email": "your@domain.com",\n      "name": "Your Name"\n    },\n    "to": [\n      {\n        "email": "your@client.com",\n        "name": "Your Client"\n      }\n    ],\n    "subject": "Subject",\n    "text": "This is the text content",\n    "html": "<p>This is the HTML content</p>",\n  }\n]\n\nprint(mailer.send_bulk(mail_list))\n```\n\n### Get bulk email status\n\n```python\nfrom mailersend import emails\n\napi_key = "API key here"\n\nmailer = mailersend.NewEmail(api_key)\n\nprint(mailer.get_bulk_status_by_id("bulk-email-id"))\n```\n\n<a name="activity"></a>\n\n## Activity\n\n### Get a list of activities (simple)\n\n```python\nfrom mailersend import activity\n\napi_key = "API key here"\n\nmailer = activity.NewActivity(api_key)\n\nmailer.get_domain_activity("domain-id")\n```\n\n### Get a list of activities (full)\n\n```python\nfrom mailersend import activity\n\napi_key = "API key here"\n\nmailer = activity.NewActivity(api_key)\n\npage = 1\nlimit = 20\ndate_from = 1623073576\ndate_to = 1623074976\nevents = [\n    "processed",\n    "queued",\n    "sent",\n    "delivered",\n    "soft-bounced",\n    "hard-bounced",\n    "junk",\n    "opened",\n    "clicked",\n    "unsubscribed",\n    "spam_complaints",\n]\n\nmailer.get_domain_activity("domain-id", page, limit, date_from, date_to, events)\n```\n\n## Analytics\n\n### Activity data by date\n\n```python\nfrom mailersend import analytics\n\napi_key = "API key here"\n\nmailer = analytics.NewAnalytics(api_key)\n\ndate_from = 1623073576\ndate_to = 1623074976\nevents = [\n    "processed",\n    "sent",\n]\n\n# optional arguments\ndomain_id = "domain-id"\ngroup_by = "days"\n\nmailer.get_activity_by_date(date_from, date_to, events, domain_id, group_by)\n```\n\n### Opens by country\n\n```python\nfrom mailersend import analytics\n\napi_key = "API key here"\n\nmailer = analytics.NewAnalytics(api_key)\n\ndate_from = 1623073576\ndate_to = 1623074976\n\n# optional arguments\ndomain_id = "domain-id"\n\nmailer.get_opens_by_country(date_from, date_to, domain_id)\n```\n\n### Opens by user-agent name\n\n```python\nfrom mailersend import analytics\n\napi_key = "API key here"\n\nmailer = analytics.NewAnalytics(api_key)\n\ndate_from = 1623073576\ndate_to = 1623074976\n\n# optional arguments\ndomain_id = "domain-id"\n\nmailer.get_opens_by_user_agent(date_from, date_to, domain_id)\n```\n\n### Opens by reading environment\n\n```python\nfrom mailersend import analytics\n\napi_key = "API key here"\n\nmailer = analytics.NewAnalytics(api_key)\n\ndate_from = 1623073576\ndate_to = 1623074976\n\n# optional arguments\ndomain_id = "domain-id"\n\nmailer.get_opens_by_reading_environment(date_from, date_to, domain_id)\n```\n\n## Inbound Routes\n\n### Get a list of inbound routes\n\n```python\nfrom mailersend import inbound_routing\n\napi_key = "API key here"\n\nmailer = inbound_routing.NewInbound(api_key)\n\nprint(mailer.get_inbound_routes())\n```\n\n### Get a single inbound route\n\n```python\nfrom mailersend import inbound_routing\n\napi_key = "API key here"\n\nmailer = inbound_routing.NewInbound(api_key)\n\nprint(mailer.get_inbound_by_id("inbound-id"))\n```\n\n### Add an inbound route\n\n```python\nfrom mailersend import inbound_routing\n\nmailer = inbound_routing.NewInbound()\n\noptions = {}\n\n_catch_filter = {\n    "type": "catch_recipient",\n    "filters": [\n        {\n            "comparer": "equal",\n            "value": "test"\n        }\n    ]\n}\n\n_match_filter = {\n    "type": "match_all"\n}\n\n_forwards = [\n    {\n        "type": "webhook",\n        "value": "https://www.mailersend.com/hook"\n    }\n]\nmailer.set_name("Example route", options)\nmailer.set_domain_enabled(True, options)\nmailer.set_inbound_domain("test.remotecompany.com", options)\nmailer.set_catch_filter(_catch_filter, options)\n\nprint(mailer.add_inbound_route())\n```\n\n### Update an inbound route\n\n```python\nfrom mailersend import inbound_routing\n\nroute_id = "inbound-route-id"\n\nmailer = inbound_routing.NewInbound()\n\noptions = {}\n\n_catch_filter = {\n    "type": "catch_recipient",\n    "filters": [\n        {\n            "comparer": "equal",\n            "value": "test"\n        }\n    ]\n}\n\n_match_filter = {\n    "type": "match_all"\n}\n\n_forwards = [\n    {\n        "type": "webhook",\n        "value": "https://www.mailersend.com/hook"\n    }\n]\nmailer.set_name("Example route", options)\nmailer.set_domain_enabled(True, options)\nmailer.set_inbound_domain("test.remotecompany.com", options)\nmailer.set_catch_filter(_catch_filter, options)\n\nprint(mailer.update_inbound_route(route_id))\n```\n\n### Delete an inbound route\n\n```python\nfrom mailersend import inbound_routing\n\napi_key = "API key here"\nroute_id = "inbound-route-id"\n\nmailer = inbound_routing.NewInbound(api_key)\n\nprint(mailer.delete_inbound_route(route_id))\n```\n\n## Domains\n\n### Get a list of domains\n\n```python\nfrom mailersend import domains\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\n\nmailer.get_domains()\n```\n\n### Get a single domain\n\n```python\nfrom mailersend import domains\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\n\nmailer.get_domain_by_id("domain-id")\n```\n\n### Get a single domain using helper function\n\n```python\nfrom mailersend import domains\nfrom mailersend import utils\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\nhelper = utils.NewHelper(api_key)\n\nmailer.get_domain_by_id(helper.get_id_by_name("domains","domain-name"))\n```\n\n### Add a domain\n\nYou can find a full list of settings [here](https://developers.mailersend.com/api/v1/domains.html#request-parameters-3).\n\n```python\nfrom mailersend import domains\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\n\nmailer.add_domain("name", "example.com")\n```\n\n\n### Delete a domain\n\n```python\nfrom mailersend import domains\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\n\nmailer.delete_domain("domain-id")\n```\n\n### Get a list of recipients per domain\n\n```python\nfrom mailersend import domains\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\n\nmailer.get_recipients_for_domain("domain-id")\n```\n\n### Update domain settings\n\nYou can find a full list of settings [here](https://developers.mailersend.com/api/v1/domains.html#request-body).\n\n```python\nfrom mailersend import domains\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\n\nmailer.update_domain_setting("domain-id", "send_paused", True)\n```\n\n### Get DNS Records\n\n```python\nfrom mailersend import domains\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\n\nmailer.get_dns_records("domain-id")\n```\n\n### Verify a domain\n\n```python\nfrom mailersend import domains\n\napi_key = "API key here"\n\nmailer = domains.NewDomain(api_key)\n\nmailer.verify_domain("domain-id")\n```\n\n\n## Messages\n\n### Get a list of messages\n\n```python\nfrom mailersend import messages\n\napi_key = "API key here"\n\nmailer = messages.NewMessage(api_key)\n\nmailer.get_messages()\n```\n\n### Get a single message\n\n```python\nfrom mailersend import messages\n\napi_key = "API key here"\n\nmailer = messages.NewMessage(api_key)\n\nmailer.get_message_by_id("message-id")\n```\n\n## Scheduled messages\n\n### Get a list of scheduled messages\n\n```python\nfrom mailersend import scheduled_messages\n\napi_key = "API key here"\n\nmailer = scheduled_messages.NewMessageSchedule(api_key)\n\nprint(mailer.get_scheduled_messages())\n```\n\n### Get a single scheduled message\n\n```python\nfrom mailersend import scheduled_messages\n\napi_key = "API key here"\n\nmailer = scheduled_messages.NewMessageSchedule(api_key)\n\nprint(mailer.get_scheduled_message_by_id("scheduled-message-id"))\n```\n\n### Delete a scheduled message\n\n```python\nfrom mailersend import scheduled_messages\n\napi_key = "API key here"\n\nmailer = scheduled_messages.NewMessageSchedule(api_key)\n\nprint(mailer.delete_scheduled_message("scheduled-message-id"))\n```\n\n## Recipients\n\n### Get a list of recipients\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nmailer.get_recipients()\n```\n\n### Get a single recipient\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nmailer.get_recipient_by_id("recipient-id")\n```\n\n### Delete a recipient\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nmailer.delete_recipient("recipient-id")\n```\n\n### Get recipients from a blocklist\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nmailer.get_recipients_from_blocklist("domain-id")\n```\n\n### Get recipients from hard bounces\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nmailer.get_hard_bounces("domain-id")\n```\n\n### Get recipients from spam complaints\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nmailer.get_spam_complaints("domain-id")\n```\n\n### Get recipients from unsubscribes\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nmailer.get_unsubscribes("domain-id")\n```\n\n### Add recipients to blocklist\n\nUsing recipients:\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_list = [\n    \'blocked@client.com\'\n]\n\nmailer.add_to_blocklist("domain-id", recipients=recipient_list)\n```\n\nUsing patterns:\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_patterns = [\n    \'*@client.com\'\n]\n\nmailer.add_to_blocklist("domain-id", patterns=recipient_patterns)\n```\n\n### Add hard bounced recipients\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_list = [\n    "your@client.com"\n]\n\nmailer.add_hard_bounces("domain-id", recipient_list)\n```\n\n### Add spam complaints\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_list = [\n    "your@client.com"\n]\n\nmailer.add_spam_complaints("domain-id", recipient_list)\n```\n\n### Add recipients to unsubscribe list\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_list = [\n    "your@client.com"\n]\n\nmailer.add_unsubscribes("domain-id", recipient_list)\n```\n\n### Delete recipients from blocklist\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_list = [\n    "your@client.com"\n]\n\nmailer.delete_from_blocklist("domain-id", recipient_list)\n```\n\n### Delete hard bounced recipients\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_list = [\n    "your@client.com"\n]\n\nmailer.delete_hard_bounces("domain-id", recipient_list)\n```\n\n### Delete spam complaints\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_list = [\n    "your@client.com"\n]\n\nmailer.delete_spam_complaints("domain-id", recipient_list)\n```\n\n### Delete recipients from unsubscribe list\n\n```python\nfrom mailersend import recipients\n\napi_key = "API key here"\n\nmailer = recipients.NewRecipient(api_key)\n\nrecipient_list = [\n    "your@client.com"\n]\n\nmailer.delete_unsubscribes("domain-id", recipient_list)\n```\n\n## Tokens\n\n### Create a token\n\n```python\nfrom mailersend import tokens\n\napi_key = "API key here"\n\nmailer = tokens.NewToken(api_key)\n\nscopes = ["email_full", "analytics_read"]\n\nmailer.create_token("my-token", scopes)\n```\n\nBecause of security reasons, we only allow access token appearance once during creation. In order to see the access token created you can do:\n\n```python\nfrom mailersend import tokens\n\napi_key = "API key here"\n\nmailer = tokens.NewToken(api_key)\n\nscopes = ["email_full", "analytics_read"]\n\nprint(mailer.create_token("my-token", scopes))\n```\n\n### Pause / Unpause Token\n\n```python\nfrom mailersend import tokens\n\napi_key = "API key here"\n\nmailer = tokens.NewToken(api_key)\n\n# pause\nmailer.update_token("my-token")\n\n# unpause\nmailer.update_token("my-token", pause=False)\n```\n\n### Delete a Token\n\n```python\nfrom mailersend import tokens\n\napi_key = "API key here"\n\nmailer = tokens.NewToken(api_key)\n\nmailer.delete_token("token-id")\n```\n\n## Templates\n\n### Get a list of templates\n\n```python\nfrom mailersend import templates\n\napi_key = "API key here"\n\nmailer = templates.NewTemplate(api_key)\n\nmailer.get_templates()\n```\n\n### Get a single template\n\n```python\nfrom mailersend import templates\n\napi_key = "API key here"\n\nmailer = templates.NewTemplate(api_key)\ntemplate_id = 1234\n\nmailer.get_template_by_id()\n```\n\n### Delete template\n\n```python\nfrom mailersend import templates\n\napi_key = "API key here"\n\nmailer = templates.NewTemplate(api_key)\ntemplate_id = 1234\n\nmailer.delete_template()\n```\n\n## Webhooks\n\n### Get a list of webhooks\n\n```python\nfrom mailersend import webhooks\n\napi_key = "API key here"\n\nmailer = webhooks.NewWebhook(api_key)\n\nmailer.get_webhooks("domain-id")\n```\n\n### Get a single webhook\n\n```python\nfrom mailersend import webhooks\n\napi_key = "API key here"\n\nmailer = webhooks.NewWebhook(api_key)\n\nmailer.get_webhook_by_id("webhook-id")\n```\n\n### Create a Webhook\n\n```python\nfrom mailersend import webhooks\n\napi_key = "API key here"\n\nwebhookEvents = [\'activity.sent\', \'activity.delivered\']\n\nwebhook = webhooks.NewWebhook(api_key)\nwebhook.set_webhook_url("https://webhooks.mysite.com")\nwebhook.set_webhook_name("my first webhook")\nwebhook.set_webhook_events(webhookEvents)\nwebhook.set_webhook_domain("domain-id")\n\nwebhook.create_webhook()\n```\n\n### Create a disabled webhook\n\n```python\nfrom mailersend import webhooks\n\napi_key = "API key here"\n\nwebhookEvents = [\'activity.sent\', \'activity.delivered\']\n\nwebhook = webhooks.NewWebhook(api_key)\nwebhook.set_webhook_url("https://webhooks.mysite.com")\nwebhook.set_webhook_name("my first webhook")\nwebhook.set_webhook_events(webhookEvents)\nwebhook.set_webhook_domain("domain-id")\nwebhook.set_webhook_enabled(False)\n\nwebhook.create_webhook()\n```\n\n### Update a Webhook\n\n```python\nfrom mailersend import webhooks\n\napi_key = "API key here"\n\nwebhook = webhooks.NewWebhook(api_key)\n\nwebhook.update_webhook("webhook-id", "name", "a new webhook name")\n```\n\n### Disable/Enable a Webhook\n\n```python\nfrom mailersend import webhooks\n\napi_key = "API key here"\n\nwebhook = webhooks.NewWebhook(api_key)\n\nwebhook.update_webhook("webhook-id", "enabled", False)\n```\n\n### Delete a Webhook\n\n```python\nfrom mailersend import webhooks\n\napi_key = "API key here"\n\nwebhook = webhooks.NewWebhook(api_key)\n\nwebhook.delete_webhook("webhook-id")\n```\n\n## SMS\n\n### Sending SMS messages\n```python\nfrom mailersend import sms_sending\n\napi_key = "API key here"\n\nmailer = sms_sending.NewSmsSending(api_key)\n\n#Number belonging to your account in E164 format\nnumber_from = "+11234567890"\n\n#You can add up to 50 recipient numbers\nnumbers_to = [\n    "+11234567891",\n    "+11234567892"\n]\ntext = "This is the text content"\n\nprint(mailer.send_sms(number_from, numbers_to, text))\n```\n\n## SMS Activity\n\n### Get a list of activities\n```python\nfrom mailersend import sms_activity\n\napi_key = "API key here"\n\nmailer = sms_activity.NewSmsActivity(api_key)\n\n#Request parameters\nsms_number_id = 1365743\ndate_from = 1655157601\ndate_to = 1655158601\nstatus = ["queued", "failed"]\npage = 1\nlimit = 200\n\nprint(mailer.get_activities(sms_number_id=sms_number_id, date_from=date_from, date_to=date_to, status=status, page=page, limit=limit))\n```\n\n### Get activity of a single message\n```python\nfrom mailersend import sms_activity\n\napi_key = "API key here"\n\nmailer = sms_activity.NewSmsActivity(api_key)\n\n#Request parameters\nsms_message_id = "62a9d12b07852eaf2207b417"\n\nprint(mailer.get_activity(sms_message_id))\n```\n\n## SMS Phone Numbers\n\n### Get a list of SMS phone numbers\n```python\nfrom mailersend import sms_phone_numbers\n\napi_key = "API key here"\n\nmailer = sms_phone_numbers.NewSmsNumbers(api_key)\n\n#Request parameters\npaused = False\n\nprint(mailer.get_phone_numbers(paused))\n```\n\n### Get an SMS phone number\n```python\nfrom mailersend import sms_phone_numbers\n\napi_key = "API key here"\n\nmailer = sms_phone_numbers.NewSmsNumbers(api_key)\n\n#Request parameters\nsms_number_id = "9pq3enl6842vwrzx"\n\nprint(mailer.get_phone_number(sms_number_id))\n```\n\n### Update a single SMS phone number\n```python\nfrom mailersend import sms_phone_numbers\n\napi_key = "API key here"\n\nmailer = sms_phone_numbers.NewSmsNumbers(api_key)\n\n#Request parameters\nsms_number_id = "9pq3enl6842vwrzx"\npaused = True\n\nprint(mailer.update_phone_number(sms_number_id, paused))\n```\n\n### Delete an SMS phone number\n```python\nfrom mailersend import sms_phone_numbers\n\napi_key = "API key here"\n\nmailer = sms_phone_numbers.NewSmsNumbers(api_key)\n\n#Request parameters\nsms_number_id = "9pq3enl6842vwrzx"\n\nprint(mailer.delete_phone_number(sms_number_id))\n```\n\n## SMS Recipients\n\n### Get a list of SMS recipients\n```python\nfrom mailersend import sms_recipients\n\napi_key = "API key here"\n\nmailer = sms_recipients.NewSmsRecipients(api_key)\n\n#Request parameters\nsms_number_id = "9pq3enl6842vwrzx"\nstatus = "active"\n\nprint(mailer.get_recipients(status=status, sms_number_id=sms_number_id))\n```\n\n### Get an SMS recipient\n```python\nfrom mailersend import sms_recipients\n\napi_key = "API key here"\n\nmailer = sms_recipients.NewSmsRecipients(api_key)\n\n#Request parameters\nsms_recipient_id = "627e756fd30078fb2208cc87"\n\nprint(mailer.get_recipient(sms_recipient_id))\n```\n\n### Update a single SMS recipient\n```python\nfrom mailersend import sms_recipients\n\napi_key = "API key here"\n\nmailer = sms_recipients.NewSmsRecipients(api_key)\n\n#Request parameters\nsms_recipient_id = "627e756fd30078fb2208cc87"\nstatus = "opt_out"\n\nprint(mailer.update_recipient(sms_recipient_id, status))\n```\n\n## SMS Messages\n\n### Get a list of SMS messages\n```python\nfrom mailersend import sms_messages\n\napi_key = "API key here"\n\nmailer = sms_messages.NewSmsMessages(api_key)\n\nprint(mailer.get_messages())\n```\n\n### Get an SMS message\n```python\nfrom mailersend import sms_messages\n\napi_key = "API key here"\n\n#Request parameters\nsms_message_id = "627e756fd30078fb2208cc87"\n\nmailer = sms_messages.NewSmsMessages(api_key)\n\nprint(mailer.get_message(sms_message_id))\n```\n\n## SMS Webhooks\n\n### Get a list of SMS webhooks\n```python\nfrom mailersend import sms_webhooks\n\napi_key = "API key here"\n\nmailer = sms_webhooks.NewSmsWebhooks(api_key)\n\n#Request parameters\nsms_number_id = "9pq3enl6842vwrzx"\n\nprint(mailer.get_webhooks(sms_number_id))\n```\n\n### Get a single SMS webhook\n```python\nfrom mailersend import sms_webhooks\n\napi_key = "API key here"\n\nmailer = sms_webhooks.NewSmsWebhooks(api_key)\n\n#Request parameters\nsms_webhook_id = "aaui13enl12f2vzx"\n\nprint(mailer.get_webhook(sms_webhook_id))\n```\n\n### Create an SMS webhook\n```python\nfrom mailersend import sms_webhooks\n\napi_key = "API key here"\n\nmailer = sms_webhooks.NewSmsWebhooks(api_key)\n\n#Request parameters\nurl = "https://webhook-url.com"\nname = "My Webhook Name"\nevents = ["sms.sent"]\nsms_number_id = "9pq3enl6842vwrzx"\nenabled = True\n\nprint(mailer.create_webhook(url, name, events, sms_number_id, enabled))\n```\n\n### Update a single SMS webhook\n```python\nfrom mailersend import sms_webhooks\n\napi_key = "API key here"\n\nmailer = sms_webhooks.NewSmsWebhooks(api_key)\n\n#Request parameters\nurl = "https://different-url.com"\nname = "New Webhook Name"\nevents = ["sms.sent", "sms.failed"],\nsms_webhook_id = "aaui13enl12f2vzx"\nenabled = False\n\nprint(mailer.update_webhook(sms_webhook_id, url, name, events, enabled))\n```\n\n### Delete an SMS webhook\n```python\nfrom mailersend import sms_webhooks\n\napi_key = "API key here"\n\nmailer = sms_webhooks.NewSmsWebhooks(api_key)\n\n#Request parameters\nsms_webhook_id = "aaui13enl12f2vzx"\n\nprint(mailer.delete_webhook(sms_webhook_id))\n```\n\n### Get a list of SMS webhooks\n```python\nfrom mailersend import sms_webhooks\n\napi_key = "API key here"\n\nmailer = sms_webhooks.NewSmsWebhooks(api_key)\n\n#Request parameters\nsms_number_id = "9pq3enl6842vwrzx"\n\nprint(mailer.get_webhooks(sms_number_id))\n```\n\n## SMS Inbouds\n\n### Get a list of SMS inbound routes\n```python\nfrom mailersend import sms_inbounds\n\napi_key = "API key here"\n\nmailer = sms_inbounds.NewSmsInbounds(api_key)\n\n#Request parameters\nsms_number_id = "123456789"\nenabled = True\npage = 1\nlimit = 25\n\nprint(mailer.get_inbound_routes(sms_number_id, enabled, page, limit))\n```\n\n### Get a single SMS inbound route\n```python\nfrom mailersend import sms_inbounds\n\napi_key = "API key here"\n\nmailer = sms_inbounds.NewSmsInbounds(api_key)\n\n#Request parameters\nsms_inbound_id = "123456789"\n\nprint(mailer.get_inbound_route(sms_inbound_id))\n```\n\n### Create an SMS inbound route\n```python\nfrom mailersend import sms_inbounds\n\napi_key = "API key here"\n\nmailer = sms_inbounds.NewSmsInbounds(api_key)\n\n#Request parameters\nsms_number_id = "123456789"\nname = "My route"\nforward_url = "https://some.url"\nfilter = {\n    "comparer": "equal",\n    "value": "START"\n}\nenabled = True\n\nprint(mailer.create_inbound_route(sms_number_id, name, forward_url, filter, enabled))\n```\n\n### Update an SMS inbound route\n```python\nfrom mailersend import sms_inbounds\n\napi_key = "API key here"\n\nmailer = sms_inbounds.NewSmsInbounds(api_key)\n\n#Request parameters\nsms_number_id = "123456789"\nname = "New name"\nforward_url = "https://news.url"\nfilter = {\n    "comparer": "contains",\n    "value": "some-value"\n}\nenabled = True\n\nprint(mailer.update_inbound_route(sms_number_id, name, forward_url, filter, enabled))\n```\n\n### Delete an SMS inbound route\n```python\nfrom mailersend import sms_inbounds\n\napi_key = "API key here"\n\nmailer = sms_inbounds.NewSmsInbounds(api_key)\n\n#Request parameters\nsms_inbound_id = "123456789"\n\nprint(mailer.delete_inbound_route()(sms_inbound_id))\n```\n\n# Troubleshooting\n\n## Emails not being sent\n\nPrint the output of `mailer.send()` to view status code and errors.\n\n```python\nfrom mailersend import emails\n\nmailer = emails.NewEmail()\n\nmail_body = {}\n\n...\n\nprint(mailer.send(mail_body))\n\n# 422\n# {"message":"The given data was invalid.","errors":{"variables.0.substitutions":["The variables.0.substitutions field is required when variables.0.email is present."]}}\n\n```\n\n# Testing\n\nTBD\n\n<a name="endpoints"></a>\n# Available endpoints\n\n| Feature group     | Endpoint                                | Available |\n|-------------------|-----------------------------------------|-----------|\n| Activity          | `GET activity`                          | ✅         |\n| Analytics         | `GET analytics`                         | ✅         |\n| Domains           | `{GET, PUT, DELETE} domains`            | ✅         |\n| Emails            | `POST send`                             | ✅         |\n| Messages          | `GET messages`                          | ✅         |\n| Recipients        | `{GET, DELETE} recipients`              | ✅         |\n| Templates         | `{GET, DELETE} templates`               | ✅         |\n| Tokens            | `{POST, PUT, DELETE} tokens`            | ✅         |\n| Webhooks          | `{GET, POST, PUT, DELETE} webhooks`     | ✅         |\n| SMS Sending       | `{POST} sms`                            | ✅         |\n| SMS Activity      | `{GET} sms-activity`                    | ✅         |\n| SMS Phone numbers | `{GET, PUT, DELETE} sms-numbers`        | ✅         |\n| SMS Recipients    | `{GET, PUT} sms-recipients`             | ✅         |\n| SMS Messages      | `{GET} sms-messages`                    | ✅         |\n| SMS Webhooks      | `{GET, POST, PUT, DELETE} sms-webhooks` | ✅         |\n| SMS Inbounds      | `{GET, POST, PUT, DELETE} sms-inbounds` | ✅         |\n\n*If, at the moment, some endpoint is not available, please use other available tools to access it. [Refer to official API docs for more info](https://developers.mailersend.com/).*\n\n\n<a name="support-and-feedback"></a>\n# Support and Feedback\n\nIn case you find any bugs, submit an issue directly here in GitHub.\n\nYou are welcome to create SDK for any other programming language.\n\nIf you have any troubles using our API or SDK free to contact our support by email [info@mailersend.com](mailto:info@mailersend.com)\n\nThe official documentation is at [https://developers.mailersend.com](https://developers.mailersend.com)\n\n<a name="license"></a>\n# License\n\n[The MIT License (MIT)](LICENSE)\n',
    'author': 'Igor Hrček',
    'author_email': 'igor@mailerlite.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': None,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.7,<4.0',
}


setup(**setup_kwargs)
