Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move recaptcha and mailchimp integrations to event handlers
- Loading branch information
1 parent
29d1988
commit da7f74f
Showing
3 changed files
with
25 additions
and
32 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
event-handlers/Emergence/People/RegistrationRequestHandler/beforeRegister/recaptcha.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
<?php | |||
|
|||
if ($recaptcha = \RemoteSystems\ReCaptcha::getInstance()) { | |||
$recaptchaResponse = $recaptcha->verify($_EVENT['requestData']['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); | |||
|
|||
if (!$recaptchaResponse->isSuccess()) { | |||
$_EVENT['additionalErrors']['ReCaptcha'] = 'Please prove that you aren\'t a spam robot by completing the reCAPTCHA'; | |||
} | |||
} |
16 changes: 16 additions & 0 deletions
16
event-handlers/Emergence/People/RegistrationRequestHandler/registerComplete/mailchimp.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
<?php | |||
|
|||
// add new user to a MailChimp list (see http://forum.laddr.us/t/mailchimp-integration/26) | |||
#\RemoteSystems\MailChimp::call('lists/subscribe', [ | |||
# 'id' => 'YOUR_LIST_ID_HERE', | |||
# 'email' => [ | |||
# 'email' => $_EVENT['User']->Email | |||
# ], | |||
# 'merge_vars' => [ | |||
# 'FNAME' => $_EVENT['User']->FirstName, | |||
# 'LNAME' => $_EVENT['User']->LastName | |||
# ], | |||
# 'double_optin' => false, | |||
# 'replace_interests' => false, | |||
# 'send_welcome' => false | |||
#]); |
32 changes: 0 additions & 32 deletions
32
php-config/Emergence/People/RegistrationRequestHandler.config.php
This file was deleted.
Oops, something went wrong.