systopia / de.systopia.twingle

CiviCRM Twingle Integration
Other
4 stars 2 forks source link

twingles option "Double-Opt-In per E-Mail" regarding newsletter is not being handled correctly #95

Closed m-pire closed 4 months ago

m-pire commented 4 months ago

My tests for a newsletter subscription with activated double-opt-in setting didnt worked out, instead the contact was added directly to the configured group.

As I assume, there is an error in api/v3/TwingleDonation/Submit.php, Line 533-537:

if ( (bool) $profile->getAttribute('newsletter_double_opt_in') && (bool) ($params['newsletter'] ?? FALSE) && is_array($groups = $profile->getAttribute('newsletter_groups')) )

From my understanding, $profile is used for the configured twingle profile within CiviCRM, and the array $params contains the values handed over by twingle. Whilst the parameter newsletter_double_opt_in is not beeing configured in the profile within CiviCRM but in the twinglemanager settings: Should this be

if ( (bool) $profile->$params['newsletter_double_opt_in'] && (bool) ($params['newsletter'] ?? FALSE) && is_array($groups = $profile->getAttribute('newsletter_groups')) )

with a an according declaration in function _civicrm_api3_twingle_donation_Submit_spec ?

Thank you so much!

MarcMichalsky commented 4 months ago

My tests for a newsletter subscription with activated double-opt-in setting didnt worked out, instead the contact was added directly to the configured group.

@m-pire Just to make sure I understand you correctly: The contact should be added to the group with a pending status. In your case, the contact is added to the group with the status Added?

MarcMichalsky commented 4 months ago

And another thing: the double opt-in setting in TwingleMANAGER is not taken into account by CiviCRM, because Twingle sends a DOI mail, but cannot pass on the updated status to CiviCRM (see here #34 ). Therefore, I have developed the option to let CiviCRM handle the DOI (see here #38). This must be activated in the respective Twingle profile in CiviCRM.

m-pire commented 4 months ago

Dear @MarcMichalsky, Yes: The contact should be added to the group with a pending status. In your case, the contact is added to the group with the status Added.

I set up a fresh install of CiviCRM and this extension - cest voila! We are using the extension with version 1.2.2 in our PROD, which does not have the mentioned setting "Use Double-Opt-In for newsletter" in its profile settings. In my freshly installed Civi I use 1.3, there it is. Sorry thad I bothered you with this and thank you for getting into this!

MarcMichalsky commented 4 months ago

You're welcome! I'm happy to help!