Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HTTPS for documentation and test fixture URLs #91

Merged
merged 8 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Guidelines for contributing

1. [Fork the repository](https://help.github.com/articles/fork-a-repo).
2. [Create a topic branch](http://learn.github.com/p/branching.html).
1. [Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
2. [Create a topic branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches).
3. Make your changes, including tests for your changes which maintain [coverage](https://coveralls.io/r/campaignmonitor/createsend-python).
4. Ensure that all tests pass, by running `rake`.
5. It should go without saying, but do not increment the version number in your commits.
6. [Submit a pull request](https://help.github.com/articles/using-pull-requests).
6. [Submit a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).
13 changes: 12 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# createsend-python history

## v9.1.3 - 4 Feb, 2025
* Updated cacert.pem. From [#92](https://github.com/campaignmonitor/createsend-python/pull/92)
* Updates various URLs to use HTTPS
* Fixes some URLs in CONTRIBUTING.md
* Use GH Workflow badge instead of inactive Travis one in documentation. From [#91](https://github.com/campaignmonitor/createsend-python/pull/91)


## v9.1.2 - 29 Jan, 2025
* This release updates the add() and update() methods in lib/subscriber.py, enabling users to add subscribers' mobile numbers along with their consent to receive SMS messages.
* Updated subscriber.py within samples to showcase new use cases resulting from these updates. [PR](https://github.com/campaignmonitor/createsend-python/pull/90)

## v9.0.2 - 23 Jan, 2025
* Improved error handling for 400 and 500 errors: Now displays error codes and error messages for better debugging.

Expand Down Expand Up @@ -172,7 +183,7 @@

## v3.1.0 - 15 Apr, 2013

* Added support for [single sign on](http://www.campaignmonitor.com/api/account/#single_sign_on) which allows initiation of external login sessions to Campaign Monitor.
* Added support for [single sign on](https://www.campaignmonitor.com/api/account/#single_sign_on) which allows initiation of external login sessions to Campaign Monitor.

## v3.0.0 - 25 Mar, 2013

Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# createsend

A Python library which implements the complete functionality of the [Campaign Monitor API](http://www.campaignmonitor.com/api/). Requires Python 3.8 or above.
A Python library which implements the complete functionality of the [Campaign Monitor API](https://www.campaignmonitor.com/api/). Requires Python 3.8 or above.

## Installation

Expand All @@ -14,9 +14,9 @@ The Campaign Monitor API supports authentication using either OAuth or an API ke

### Using OAuth

Depending on the environment you are developing in, you may wish to use a Python OAuth library to get access tokens for your users. If you use [Flask](http://flask.pocoo.org/), you may like to refer to this [example application](https://gist.github.com/jdennes/4754097), which uses the [Flask-OAuth](http://pythonhosted.org/Flask-OAuth/) package to authenticate.
Depending on the environment you are developing in, you may wish to use a Python OAuth library to get access tokens for your users. If you use [Flask](https://flask.palletsprojects.com/en/stable/), you may like to refer to this [example application](https://gist.github.com/jdennes/4754097), which uses the [Flask-OAuth](https://pythonhosted.org/Flask-OAuth/) package to authenticate.

If you don't use an OAuth library, you will need to manually get access tokens for your users by following the instructions included in the Campaign Monitor API [documentation](http://www.campaignmonitor.com/api/getting-started/#authenticating_with_oauth). This package provides functionality to help you do this, as described below. There's also another Flask [example application](https://gist.github.com/jdennes/4761254) you may wish to reference, which doesn't depend on any OAuth libraries.
If you don't use an OAuth library, you will need to manually get access tokens for your users by following the instructions included in the Campaign Monitor API [documentation](https://www.campaignmonitor.com/api/v3-3/getting-started/#authentication). This package provides functionality to help you do this, as described below. There's also another Flask [example application](https://gist.github.com/jdennes/4761254) you may wish to reference, which doesn't depend on any OAuth libraries.

The first thing your application should do is redirect your user to the Campaign Monitor authorization URL where they will have the opportunity to approve your application to access their Campaign Monitor account. You can get this authorization URL by using the `authorize_url()` function, like so:

Expand Down Expand Up @@ -204,7 +204,7 @@ For example, if you wanted to find out how to call the `Subscriber.add()` method
```python
def test_add_with_custom_fields(self):
self.subscriber.stub_request("subscribers/%s.json" % self.list_id, "add_subscriber.json")
custom_fields = [ { "Key": 'website', "Value": 'http://example.com/' } ]
custom_fields = [ { "Key": 'website', "Value": 'https://example.com/' } ]
email_address = self.subscriber.add(self.list_id, "[email protected]", "Subscriber", custom_fields, True)
self.assertEqual(email_address, "[email protected]")
```
Expand Down Expand Up @@ -247,7 +247,6 @@ Please check the [instructions for releasing](https://github.com/campaignmonitor

## This stuff should be green

[![Build Status](https://secure.travis-ci.org/campaignmonitor/createsend-python.png)][travis] [![Coverage Status](https://coveralls.io/repos/campaignmonitor/createsend-python/badge.png?branch=master)][coveralls]
[![Python tests](https://github.com/campaignmonitor/createsend-python/actions/workflows/tests.yml/badge.svg)](https://github.com/campaignmonitor/createsend-python/actions/workflows/tests.yml) [![Coverage Status](https://coveralls.io/repos/campaignmonitor/createsend-python/badge.png?branch=master)][coveralls]

[travis]: http://travis-ci.org/campaignmonitor/createsend-python
[coveralls]: https://coveralls.io/r/campaignmonitor/createsend-python
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pip install setuptools

## Prepare the release

- Increment `version` in the `setup.py` file, ensuring that you use [Semantic Versioning](http://semver.org/).
- Increment `version` in the `setup.py` file, ensuring that you use [Semantic Versioning](https://semver.org/).
- Add an entry to `HISTORY.md` which clearly explains the new release.
- Commit your changes:

Expand All @@ -34,7 +34,7 @@ pip install setuptools
git push origin master --tags
```

- Ensure that all [tests](https://travis-ci.org/campaignmonitor/createsend-python) pass, and that [coverage](https://coveralls.io/r/campaignmonitor/createsend-python) is maintained or improved.
- Ensure that all [tests](https://github.com/campaignmonitor/createsend-python/actions/workflows/tests.yml) pass, and that [coverage](https://coveralls.io/r/campaignmonitor/createsend-python) is maintained or improved.

- Add a new [GitHub Release](https://github.com/campaignmonitor/createsend-python/releases) using the newly created tag.

Expand Down
2 changes: 1 addition & 1 deletion lib/createsend/createsend.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def external_session_url(self, email, chrome, url, integrator_id, client_id):
"""
Get a URL which initiates a new external session for the user with the
given email.
Full details: http://www.campaignmonitor.com/api/account/#single_sign_on
Full details: https://www.campaignmonitor.com/api/account/#single_sign_on

:param email: String The representing the email address of the
Campaign Monitor user for whom the login session should be created.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
description="A library which implements the complete functionality of the Campaign Monitor API.",
author='Campaign Monitor',
author_email='[email protected]',
url="http://campaignmonitor.github.io/createsend-python/",
url="https://campaignmonitor.github.io/createsend-python/",
license="MIT",
keywords="createsend campaign monitor email",
packages=find_packages('lib'),
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/active_subscribers.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://example.com"
"Value": "https://example.com"
},
{
"Key": "multi select field",
Expand Down Expand Up @@ -39,7 +39,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://subdomain.example.com"
"Value": "https://subdomain.example.com"
}
],
"ReadsEmailWith": "Gmail"
Expand All @@ -53,7 +53,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://subdomain.example.com"
"Value": "https://subdomain.example.com"
}
],
"ReadsEmailWith": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://example.com"
"Value": "https://example.com"
},
{
"Key": "multi select field",
Expand Down Expand Up @@ -40,7 +40,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://subdomain.example.com"
"Value": "https://subdomain.example.com"
}
],
"ReadsEmailWith": "Gmail",
Expand All @@ -55,7 +55,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://subdomain.example.com"
"Value": "https://subdomain.example.com"
}
],
"ReadsEmailWith": "",
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/campaign_clicks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Results": [
{
"EmailAddress": "[email protected]",
"URL": "http://video.google.com.au/?hl=en&tab=wv",
"URL": "https://video.google.com.au/?hl=en&tab=wv",
"ListID": "512a3bc577a58fdf689c654329b50fa0",
"Date": "2010-10-11 08:29:00",
"IPAddress": "192.168.126.87",
Expand All @@ -15,7 +15,7 @@
},
{
"EmailAddress": "[email protected]",
"URL": "http://mail.google.com/mail/?hl=en&tab=wm",
"URL": "https://mail.google.com/mail/?hl=en&tab=wm",
"ListID": "512a3bc577a58fdf689c654329b50fa0",
"Date": "2010-10-11 08:29:00",
"IPAddress": "192.168.126.87",
Expand All @@ -28,7 +28,7 @@
},
{
"EmailAddress": "[email protected]",
"URL": "http://mail.google.com/mail/?hl=en&tab=wm",
"URL": "https://mail.google.com/mail/?hl=en&tab=wm",
"ListID": "512a3bc577a58fdf689c654329b50fa0",
"Date": "2010-10-06 17:24:00",
"IPAddress": "192.168.126.87",
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/campaign_summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"Mentions": 23,
"Forwards": 11,
"Likes": 32,
"WebVersionURL": "http://createsend.com/t/r-3A433FC72FFE3B8B",
"WebVersionTextURL": "http://createsend.com/t/r-3A433FC72FFE3B8B/t",
"WorldviewURL": "http://client.createsend.com/reports/wv/r/3A433FC72FFE3B8B",
"WebVersionURL": "https://createsend.com/t/r-3A433FC72FFE3B8B",
"WebVersionTextURL": "https://createsend.com/t/r-3A433FC72FFE3B8B/t",
"WorldviewURL": "https://client.createsend.com/reports/wv/r/3A433FC72FFE3B8B",
"SpamComplaints": 23
}
8 changes: 4 additions & 4 deletions test/fixtures/campaigns.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Results": [
{
"WebVersionURL": "http://createsend.com/t/r-765E86829575EE2C",
"WebVersionTextURL": "http://createsend.com/t/r-765E86829575EE2C/t",
"WebVersionURL": "https://createsend.com/t/r-765E86829575EE2C",
"WebVersionTextURL": "https://createsend.com/t/r-765E86829575EE2C/t",
"CampaignID": "fc0ce7105baeaf97f47c99be31d02a91",
"Subject": "Campaign One",
"Name": "Campaign One",
Expand All @@ -14,8 +14,8 @@
"Tags": ["Tag1", "Tag2"]
},
{
"WebVersionURL": "http://createsend.com/t/r-DD543566A87C9B8B",
"WebVersionTextURL": "http://createsend.com/t/r-DD543566A87C9B8B/t",
"WebVersionURL": "https://createsend.com/t/r-DD543566A87C9B8B",
"WebVersionTextURL": "https://createsend.com/t/r-DD543566A87C9B8B/t",
"CampaignID": "072472b88c853ae5dedaeaf549a8d607",
"Subject": "Campaign Two",
"Name": "Campaign Two",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/deleted_subscribers.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://google.com"
"Value": "https://google.com"
}
],
"ReadsEmailWith": "Gmail"
Expand Down
8 changes: 4 additions & 4 deletions test/fixtures/drafts.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"FromEmail": "[email protected]",
"ReplyTo": "[email protected]",
"DateCreated": "2010-08-19 16:08:00",
"PreviewURL": "http://createsend.com/t/r-E97A7BB2E6983DA1",
"PreviewTextURL": "http://createsend.com/t/r-E97A7BB2E6983DA1/t",
"PreviewURL": "https://createsend.com/t/r-E97A7BB2E6983DA1",
"PreviewTextURL": "https://createsend.com/t/r-E97A7BB2E6983DA1/t",
"Tags": ["Tags5"]
},
{
Expand All @@ -19,8 +19,8 @@
"FromEmail": "[email protected]",
"ReplyTo": "[email protected]",
"DateCreated": "2010-08-19 16:08:00",
"PreviewURL": "http://createsend.com/t/r-E97A7BB2E6983DA1",
"PreviewTextURL": "http://createsend.com/t/r-E97A7BB2E6983DA1/t",
"PreviewURL": "https://createsend.com/t/r-E97A7BB2E6983DA1",
"PreviewTextURL": "https://createsend.com/t/r-E97A7BB2E6983DA1/t",
"Tags": []
}
]
2 changes: 1 addition & 1 deletion test/fixtures/journey_email_clicks_no_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"EmailAddress": "[email protected]",
"Date": "2019-08-19 10:23:00",
"URL": "http://mail.google.com/mail/?hl=en&tab=wm",
"URL": "https://mail.google.com/mail/?hl=en&tab=wm",
"IPAddress": "198.148.196.144",
"Latitude": -33.8591,
"Longitude": 151.200195,
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/journey_email_clicks_with_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"EmailAddress": "[email protected]",
"Date": "2019-08-19 10:23:00",
"URL": "http://mail.google.com/mail/?hl=en&tab=wm",
"URL": "https://mail.google.com/mail/?hl=en&tab=wm",
"IPAddress": "198.148.196.144",
"Latitude": -33.8591,
"Longitude": 151.200195,
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/list_webhooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"WebhookID": "943678317049bc13",
"Events": [ "Deactivate" ],
"Url": "http://www.postbin.org/d9w8ud9wud9w",
"Url": "https://www.postbin.org/d9w8ud9wud9w",
"Status": "Active",
"PayloadFormat": "Json"
},
Expand All @@ -11,7 +11,7 @@
"Events": [
"Subscribe"
],
"Url": "http://www.postbin.org/hiuhiu2h2u",
"Url": "https://www.postbin.org/hiuhiu2h2u",
"Status": "Active",
"PayloadFormat": "Xml"
}
Expand Down
8 changes: 4 additions & 4 deletions test/fixtures/scheduled_campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"FromEmail": "[email protected]",
"ReplyTo": "[email protected]",
"DateCreated": "2011-05-24 10:37:00",
"PreviewURL": "http://createsend.com/t/r-DD543521A87C9B8B",
"PreviewTextURL": "http://createsend.com/t/r-DD543521A87C9B8B/t",
"PreviewURL": "https://createsend.com/t/r-DD543521A87C9B8B",
"PreviewTextURL": "https://createsend.com/t/r-DD543521A87C9B8B/t",
"Tags": []
},
{
Expand All @@ -23,8 +23,8 @@
"FromEmail": "[email protected]",
"ReplyTo": "[email protected]",
"DateCreated": "2011-05-24 10:39:00",
"PreviewURL": "http://createsend.com/t/r-DD913521A87C9B8B",
"PreviewTextURL": "http://createsend.com/t/r-DD913521A87C9B8B/t",
"PreviewURL": "https://createsend.com/t/r-DD913521A87C9B8B",
"PreviewTextURL": "https://createsend.com/t/r-DD913521A87C9B8B/t",
"Tags": ["Tags3", "Tags4"]
}
]
2 changes: 1 addition & 1 deletion test/fixtures/subscriber_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://example.com"
"Value": "https://example.com"
},
{
"Key": "age",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"CustomFields": [
{
"Key": "website",
"Value": "http://example.com"
"Value": "https://example.com"
},
{
"Key": "age",
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/subscriber_history.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"Event": "Click",
"Date": "2010-10-12 13:16:00",
"IPAddress": "192.168.126.87",
"Detail": "http://example.com/post/12323/"
"Detail": "https://example.com/post/12323/"
},
{
"Event": "Click",
"Date": "2010-10-12 13:15:00",
"IPAddress": "192.168.126.87",
"Detail": "http://example.com/post/29889/"
"Detail": "https://example.com/post/29889/"
},
{
"Event": "Open",
Expand All @@ -32,7 +32,7 @@
"Event": "Click",
"Date": "2010-10-12 13:01:00",
"IPAddress": "192.168.126.87",
"Detail": "http://example.com/post/82211/"
"Detail": "https://example.com/post/82211/"
},
{
"Event": "Open",
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/template_details.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"TemplateID": "98y2e98y289dh89h938389",
"Name": "Template One",
"PreviewURL": "http://preview.createsend.com/createsend/templates/previewTemplate.aspx?ID=01AF532CD8889B33&d=r&c=E816F55BFAD1A753",
"ScreenshotURL": "http://preview.createsend.com/ts/r/14/833/263/14833263.jpg?0318092600"
"PreviewURL": "https://preview.createsend.com/createsend/templates/previewTemplate.aspx?ID=01AF532CD8889B33&d=r&c=E816F55BFAD1A753",
"ScreenshotURL": "https://preview.createsend.com/ts/r/14/833/263/14833263.jpg?0318092600"
}
8 changes: 4 additions & 4 deletions test/fixtures/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{
"TemplateID": "5cac213cf061dd4e008de5a82b7a3621",
"Name": "Template One",
"PreviewURL": "http://preview.createsend.com/createsend/templates/previewTemplate.aspx?ID=01AF532CD8889B33&d=r&c=E816F55BFAD1A753",
"ScreenshotURL": "http://preview.createsend.com/ts/r/14/833/263/14833263.jpg?0318092541"
"PreviewURL": "https://preview.createsend.com/createsend/templates/previewTemplate.aspx?ID=01AF532CD8889B33&d=r&c=E816F55BFAD1A753",
"ScreenshotURL": "https://preview.createsend.com/ts/r/14/833/263/14833263.jpg?0318092541"
},
{
"TemplateID": "da645c271bc85fb6550acff937c2ab2e",
"Name": "Template Two",
"PreviewURL": "http://preview.createsend.com/createsend/templates/previewTemplate.aspx?ID=C8A180629495E798&d=r&c=E816F55BFAD1A753",
"ScreenshotURL": "http://preview.createsend.com/ts/r/18/7B3/552/187B3552.jpg?0705043527"
"PreviewURL": "https://preview.createsend.com/createsend/templates/previewTemplate.aspx?ID=C8A180629495E798&d=r&c=E816F55BFAD1A753",
"ScreenshotURL": "https://preview.createsend.com/ts/r/18/7B3/552/187B3552.jpg?0705043527"
}
]
2 changes: 1 addition & 1 deletion test/fixtures/tx_message_details_with_statistics.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"EmailAddress": "[email protected]",
"Date": "2009-05-18 16:45:00",
"IPAddress": "192.168.0.1",
"URL": "http://www.myexammple.com/index.html",
"URL": "https://www.myexammple.com/index.html",
"Geolocation": {
"Latitude": -33.8683,
"Longitude": 151.2086,
Expand Down
Loading