Skip to content

Commit da7f74f

Browse files
Move recaptcha and mailchimp integrations to event handlers
1 parent 29d1988 commit da7f74f

3 files changed

Lines changed: 25 additions & 32 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
if ($recaptcha = \RemoteSystems\ReCaptcha::getInstance()) {
4+
$recaptchaResponse = $recaptcha->verify($_EVENT['requestData']['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
5+
6+
if (!$recaptchaResponse->isSuccess()) {
7+
$_EVENT['additionalErrors']['ReCaptcha'] = 'Please prove that you aren\'t a spam robot by completing the reCAPTCHA';
8+
}
9+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
// add new user to a MailChimp list (see http://forum.laddr.us/t/mailchimp-integration/26)
4+
#\RemoteSystems\MailChimp::call('lists/subscribe', [
5+
# 'id' => 'YOUR_LIST_ID_HERE',
6+
# 'email' => [
7+
# 'email' => $_EVENT['User']->Email
8+
# ],
9+
# 'merge_vars' => [
10+
# 'FNAME' => $_EVENT['User']->FirstName,
11+
# 'LNAME' => $_EVENT['User']->LastName
12+
# ],
13+
# 'double_optin' => false,
14+
# 'replace_interests' => false,
15+
# 'send_welcome' => false
16+
#]);

php-config/Emergence/People/RegistrationRequestHandler.config.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)