diff --git a/CRM/Twingle/Form/Profile.php b/CRM/Twingle/Form/Profile.php
index a38dc7e..7038470 100644
--- a/CRM/Twingle/Form/Profile.php
+++ b/CRM/Twingle/Form/Profile.php
@@ -336,6 +336,13 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form {
array('class' => 'crm-select2 huge', 'multiple' => 'multiple')
);
+ $this->add(
+ 'checkbox', // field type
+ 'double_opt_in', // field name
+ E::ts('Use Twingle\'s Double-Opt-In procedure'), // field label
+ FALSE // is not required
+ );
+
$this->add(
'select', // field type
'postinfo_groups', // field name
diff --git a/CRM/Twingle/Profile.php b/CRM/Twingle/Profile.php
index be93bc6..e0afe35 100644
--- a/CRM/Twingle/Profile.php
+++ b/CRM/Twingle/Profile.php
@@ -221,6 +221,7 @@ class CRM_Twingle_Profile {
'membership_type_id',
'membership_type_id_recur',
'membership_postprocess_call',
+ 'double_opt_in'
),
// Add payment methods.
array_keys(static::paymentInstruments()),
@@ -293,6 +294,7 @@ class CRM_Twingle_Profile {
'custom_field_mapping' => NULL,
'membership_type_id' => NULL,
'membership_type_id_recur' => NULL,
+ 'double_opt_in' => NULL,
)
// Add contribution status for all payment methods.
+ array_fill_keys(array_map(function($attribute) {
diff --git a/README.md b/README.md
index e8c2a1d..16ce32e 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,7 @@ for all newly created Twingle projects.
| CiviSEPA creditor | When enabled to integrate with CiviSEPA, specify the CiviSEPA creditor to use. |
| Gender options | Specify which CiviCRM gender option the incoming Twingle gender value should be mapped to. The list is based on your CiviCRM configuration. |
| Record *Payment method* as | Specifiy the payment methods mapping for incoming donations for each Twingle payment method. |
+| Double-Opt-In | Group membership for newsletter mailing lists will be pending until receivement of confirming API call. Usage in combination with activated Double-Opt-In in Twingle manager. |
| Sign up for groups | Whenever the donor checked the newsletter/postal mailing/donation receipt checkbox on the Twingle form, the contact will be added to the groups listed here. |
| Assign donation to campaign | The donation will be assigned to the selected campaign. If a campaign ID is being submitted using the `campaign_id` parameter, this setting will be overridden with the submitted value. |
| Create membership of type | A membership of the selected type will be created for the Individual contact for incoming one-time donations. If no membership type is selected, no membership will be created. |
@@ -148,3 +149,19 @@ The action accepts the following parameters:
You may also refer to
[the code](https://github.com/systopia/de.systopia.twingle/blob/master/api/v3/TwingleDonation/Cancel.php)
for more insight into this API action.
+
+### Double-Opt-In confirmation
+
+- Entity: `TwingleDonation`
+- Action: `doubleoptinconfirm`
+
+The action accepts the following parameters:
+
+| Parameter | Type | Description | Values/Format | Required |
+|------------------------------|--------|----------------------------------------------------|-------------------------------------------------------|----------|
+|
{$form.double_opt_in.label} | +{$form.double_opt_in.html} | +
{$form.newsletter_groups.label} | {$form.newsletter_groups.html} | diff --git a/twingle.php b/twingle.php index 214d041..d18e45e 100644 --- a/twingle.php +++ b/twingle.php @@ -151,6 +151,7 @@ function twingle_civicrm_alterAPIPermissions($entity, $action, &$params, &$permi $permissions['twingle_donation']['submit'] = array('access Twingle API'); $permissions['twingle_donation']['cancel'] = array('access Twingle API'); $permissions['twingle_donation']['endrecurring'] = array('access Twingle API'); + $permissions['twingle_donation']['doubleoptinconfirm'] = array('access Twingle API'); } // --- Functions below this ship commented out. Uncomment as required. ---