Page MenuHomePhabricator

Add double opt-in wiki page to record link clicks from email and create activities
Closed, ResolvedPublic8 Estimated Story Points

Description

See Double opt-in proposed plan

A rough sketch, with more details to come:

We will record double opt ins as activities in CiviCRM, including the timestamp of the user action, email address (for clarity and auditability as the contact's primary email may change in the future). This will allow us to export a double opt-in boolean field to Acoustic and/or suppress the email in Acoustic, as required (pending future discussions on how email suppression is canceled in Acoustic).

When a user visits the wiki page with their unique link including cid and contact hash, we will validate their cid/hash combination and then create an activity as above (using an api call via CiviProxy).

If we succeed, we show the user a page indicating success. If we fail, we show a generic failure page asking them to retry or reach out for help. In the future, we could improve this to automatically resend a new link if the contact hash has expired (which happens after 2 months, so should be rare), to give the user more information about why the failure happened, and to generally handle errors more gracefully — but given the timeline and the relatively small group this will initially be rolled out to, we're going to keep things simple to start.

When a new donor will receive this link is a subject for future discussion. Existing donors will receive via Acoustic mailing.

Timeline for this need is TBD (initial plan was for the first email to go out Nov 11, but we may delay to Q3).

Event Timeline

AnnWF set the point value for this task to 8.Sep 22 2025, 8:21 PM

An additional wrinkle for this is that we need to record double opt-ins per email address, rather than per contact. So if we record the email address for the double opt-in a custom field on the activity, then we can easily filter those activities as required when we push this data up to Acoustic.

Change #1195026 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/crm@master] New activity type for double opt-in

https://gerrit.wikimedia.org/r/1195026

Change #1195274 had a related patch set uploaded (by Ejegg; author: Ejegg):

[mediawiki/extensions/DonationInterface@master] Implement double opt-in page

https://gerrit.wikimedia.org/r/1195274

Change #1195275 had a related patch set uploaded (by Lars SG; author: Lars SG):

[wikimedia/fundraising/crm@master] Add Double opt-in activity type

https://gerrit.wikimedia.org/r/1195275

Change #1195026 abandoned by Ejegg:

[wikimedia/fundraising/crm@master] New activity type for double opt-in

Reason:

superseded by I85eab70555089fd00c42da58b9e87534ef846a37

https://gerrit.wikimedia.org/r/1195026

Change #1195338 had a related patch set uploaded (by Lars SG; author: Lars SG):

[wikimedia/fundraising/crm@master] Add Double opt-in API Action

https://gerrit.wikimedia.org/r/1195338

Change #1196092 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/dev@master] Allow doubleOptIn action in CiviProxy

https://gerrit.wikimedia.org/r/1196092

Change #1195275 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Add Double opt-in activity type

https://gerrit.wikimedia.org/r/1195275

Change #1196135 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/crm@master] Double Opt-in: always allow, change contact_id param

https://gerrit.wikimedia.org/r/1196135

Change #1195338 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Add Double opt-in API Action

https://gerrit.wikimedia.org/r/1195338

Change #1196135 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Double Opt-in: always allow, change contact_id param

https://gerrit.wikimedia.org/r/1196135

Change #1196092 merged by Ejegg:

[wikimedia/fundraising/dev@master] Allow doubleOptIn action in CiviProxy

https://gerrit.wikimedia.org/r/1196092

Change #1196974 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/crm@master] Send new links to double optIn page

https://gerrit.wikimedia.org/r/1196974

Change #1195274 merged by jenkins-bot:

[mediawiki/extensions/DonationInterface@master] Implement double opt-in page

https://gerrit.wikimedia.org/r/1195274

Change #1196974 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Send new links to double optIn page

https://gerrit.wikimedia.org/r/1196974

OK, this is deployed. The link template is as follows:

https://donorpreferences.wikimedia.org/index.php?title=Special:EmailPreferences/optIn&contact_id=<contact_id>&checksum=<checksum>&email=<email>

You can get a link for a specific contact by copying the Email Preferences link from their donor summary page and replacing EmailPreferences/emailPreference with EmailPreferences/optIn

AKanji-WMF set Final Story Points to 4.

Change #1235848 had a related patch set uploaded (by Ejegg; author: Ejegg):

[mediawiki/extensions/DonationInterface@master] Update text for opt-in success

https://gerrit.wikimedia.org/r/1235848

Change #1235848 merged by jenkins-bot:

[mediawiki/extensions/DonationInterface@master] Update text for opt-in success

https://gerrit.wikimedia.org/r/1235848