-
Notifications
You must be signed in to change notification settings - Fork 5
Add Opt Out field and MailChimp integration #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: proto/nw-demo
Are you sure you want to change the base?
Add Opt Out field and MailChimp integration #78
Conversation
…e mailchimp opt out query filters on correct bundle
yanniboi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far. A couple of tweaks.
| "#2584729: Hook entity_field_storage_info is broken": "https://www.drupal.org/files/issues/core-entity-sql-content-entity-storage-2583111-1_0.patch" | ||
| }, | ||
| "drupal/ctools": { | ||
| "#2667652: Option to expose filters in block on views block display": "https://www.drupal.org/files/issues/ctools-option_to_expose-2667652-3.patch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there not a mailchimp patch as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yanniboi Yes - this is only needed if you install contacts_mailchimp though, so should it go in the composer.json for the contacts module, or would there need to be a new composer.json specifically for contacts_mailchimp?
| @@ -0,0 +1,35 @@ | |||
| uuid: 5800747c-04df-4555-902f-b233214033a7 | |||
| langcode: en | |||
| status: true | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't tend to include uuids for config that goes in contributed modules. @andrewbelcher is that still accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the uuid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the current consensus is that UUIDs should be included in default configuration so you can see if different config entities are being managed (e.g. 2 modules provide the same profile type, UUID can tell you which one you have).
| id: 'contacts_entity:profile-crm_communications' | ||
| label: 'Communications Profile block' | ||
| provider: contacts | ||
| label_display: '0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change the label to 'Communication preferences'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied renaming
|
|
||
| // TODO: Investigate making this asynchronous. | ||
| if (($original === 0 || $original == NULL) && $opt_out === 1 && $entity->uid->entity->hasField('mail')) { | ||
| $email = $entity->uid->entity->mail->value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not many ways of doing asynchronous in Drupal. We could consider moving it to a cron queue for performance, but its probably fine for now.
These commits begin the work on adding Opt Out features for communication, as well as mailchimp integration for emails.