Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
colintucker committed May 1, 2018
2 parents b50ecf5 + ff3e90d commit 407a383
Show file tree
Hide file tree
Showing 21 changed files with 6,397 additions and 4,096 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ Please see [contributing](CONTRIBUTING.md) for more information.

## Maintainers

[![Colin Tucker](https://avatars3.githubusercontent.com/u/1853705?s=144)](https://github.com/colintucker) | [![Praxis Interactive](https://avatars2.githubusercontent.com/u/1782612?s=144)](http://www.praxis.net.au)
[![Colin Tucker](https://avatars3.githubusercontent.com/u/1853705?s=144)](https://github.com/colintucker) | [![Praxis Interactive](https://avatars2.githubusercontent.com/u/1782612?s=144)](https://www.praxis.net.au)
---|---
[Colin Tucker](https://github.com/colintucker) | [Praxis Interactive](http://www.praxis.net.au)
[Colin Tucker](https://github.com/colintucker) | [Praxis Interactive](https://www.praxis.net.au)

## License

Expand Down
Binary file added admin/client/dist/images/icons/SubscribePage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added admin/client/dist/images/icons/UnsubscribePage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added admin/client/src/images/icons/SubscribePage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added admin/client/src/images/icons/UnsubscribePage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"name": "Colin Tucker",
"role": "Developer",
"email": "[email protected]",
"homepage": "http://www.praxis.net.au"
"homepage": "https://www.praxis.net.au"
}
],
"require": {
Expand Down
38 changes: 21 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"name": "Colin Tucker",
"email": "[email protected]",
"url": "http://www.praxis.net.au"
"url": "https://www.praxis.net.au"
}
],
"repository": {
Expand All @@ -26,29 +26,33 @@
"url": "https://github.com/praxisnetau/silverware-mailchimp/issues"
},
"engines": {
"node": "^4.2.0"
"node": "^8.x"
},
"scripts": {
"watch": "webpack --env.development --colors --watch",
"build": "webpack --env.production --colors --optimize-minimize"
"build": "webpack --env.production --colors --progress --optimize-minimize"
},
"dependencies": {},
"devDependencies": {
"autoprefixer": "^7.1.5",
"autoprefixer": "^8.2.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"clean-webpack-plugin": "^0.1.17",
"copy-webpack-plugin": "^4.1.1",
"css-loader": "^0.28.7",
"extract-text-webpack-plugin": "^3.0.1",
"file-loader": "^1.1.5",
"node-sass": "^4.5.3",
"postcss-loader": "^2.0.6",
"sass-loader": "^6.0.6",
"style-loader": "^0.19.0",
"url-loader": "^0.6.2",
"webpack": "^3.6.0"
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"clean-webpack-plugin": "^0.1.19",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^0.28.11",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.11",
"node-sass": "^4.8.3",
"postcss-loader": "^2.1.3",
"resolve-url-loader": "^2.3.0",
"sass-loader": "^6.0.7",
"style-loader": "^0.20.3",
"svgo": "^1.0.5",
"svgo-loader": "^2.1.0",
"uglifyjs-webpack-plugin": "^1.2.4",
"url-loader": "^1.0.1",
"webpack": "^3.11.0"
},
"babel": {
"presets": [
Expand Down
9 changes: 8 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
module.exports = {};
/* PostCSS Configuration
===================================================================================================================== */

module.exports = {
plugins: [
require('autoprefixer')
]
};
12 changes: 12 additions & 0 deletions src/API/MailChimpAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ public function put($method, $params = [])
return $this->request('put', $method, $params);
}

/**
* Answers an MD5 hash for the given email address (used for API actions).
*
* @param string $email
*
* @return string
*/
public function hash($email)
{
return md5(strtolower(trim($email)));
}

/**
* Answers true if the last request was successful.
*
Expand Down
16 changes: 13 additions & 3 deletions src/Components/MailChimpSignupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ public function Form()

$form->restoreFormState();

// Extend Form Object:

$this->extend('updateForm', $form);

// Answer Form Object:

return $form;
Expand Down Expand Up @@ -187,7 +191,7 @@ public function doSubscribe($data, $form)

// Obtain API Response:

$response = $this->api->post(
$response = $this->api->put(
$this->getSubscribeMethod(),
[
'email_address' => $data['Email'],
Expand Down Expand Up @@ -276,10 +280,16 @@ public function doSubscribe($data, $form)
/**
* Answers the API method for adding the subscriber.
*
* @param array $data
*
* @return string
*/
protected function getSubscribeMethod()
protected function getSubscribeMethod($data)
{
return sprintf('lists/%s/members', $this->ListID);
return sprintf(
'lists/%s/members/%s',
$this->ListID,
$this->api->hash($data['Email'])
);
}
}
Loading

0 comments on commit 407a383

Please sign in to comment.