Page MenuHomePhabricator

Use Guzzle to make API request to CiviProxy to retrieve opt-in / opt-out fields.
Closed, ResolvedPublic

Description

This is to be written in DonationInterface, probably in a helper class to be used by the Special:EmailPreferences page.
Guzzle is just so it's mockable - seems to already be installed in MW vendor directory.

Event Timeline

@Ejegg I was considering looking at this tomorrow. Want to post any thoughts you've had about it? I'll have to explore CiviProxy documentation a bit.

Cstone subscribed.

Hey... can anyone provide details on how the values of the two boolean fields that Civiproxy is returning (is_opt_out and is_opt_in) map to the selection of the mutually exclusive options shown to the user on the form (" I love hearing about Wikimedia, keep your regular schedule!" vs. "Unsubscribe me from all emails")?

I think we need to translate in both directions, that is Civi->Email-Pref-Ctr and Email-Pref-Ctr->Civi. I don't know if those two boolean fields are sufficient to determine the value to show on the form?

Also, I don't see a task for the queue consumer that will read the messages and change the settings in Civi? Am I missing something? (The need for that bit has indeed been mentioned; see for example, this comment: T125272#5423248.)

For the queue consumer task I think its this one T268512

Change 677018 had a related patch set uploaded (by AndyRussG; author: AndyRussG):

[mediawiki/extensions/DonationInterface@master] Email Preference Center: Guzzle connetor to Civiproxy

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

@AndyRussG the is_opt_out field is the older one and defaulted to 0. is_opt_in is newer and defaults to NULL, indicating that the donor never saw an opt-in checkbox.

So if is_opt_out is 1 OR is_opt_in is 0, treat the donor as unsubscribed.

If is_opt_out is 0 AND is_opt_in is either 1 or NULL, treat the donor as subscribed ('regular schedule').

Change 677308 had a related patch set uploaded (by AndyRussG; author: AndyRussG):

[wikimedia/fundraising/dev@master] Add settings for email-pref-ctr connection to civiproxy

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

Change 677308 merged by Ejegg:

[wikimedia/fundraising/dev@master] Add settings for email-pref-ctr connection to civiproxy

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

Change 677018 merged by jenkins-bot:

[mediawiki/extensions/DonationInterface@master] Email Preference Center: Guzzle connetor to Civiproxy

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