From 6372be828bcc4f03cf3959fa531308b10734de38 Mon Sep 17 00:00:00 2001 From: bach Date: Thu, 9 Jun 2022 12:15:49 +0200 Subject: [PATCH] reconfigured simplenews_mail_subscriptions with right lists IDs, patch : removed api keys --- ...s.simplenews_mailjet_subsciption.19125.yml | 13 + ...s.simplenews_mailjet_subsciption.22839.yml | 13 + ...s.simplenews_mailjet_subsciption.24787.yml | 13 + ...s.simplenews_mailjet_subsciption.24788.yml | 9 + ..._mailjet_subsciption.drupal_simplenews.yml | 25 -- ...et_subscriptions__usingmailjetmodule.patch | 275 ++++++++++++++++++ 6 files changed, 323 insertions(+), 25 deletions(-) create mode 100644 config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.19125.yml create mode 100644 config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.22839.yml create mode 100644 config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.24787.yml create mode 100644 config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.24788.yml delete mode 100644 config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.drupal_simplenews.yml diff --git a/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.19125.yml b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.19125.yml new file mode 100644 index 0000000..416cfaf --- /dev/null +++ b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.19125.yml @@ -0,0 +1,13 @@ +uuid: 89d71508-f9fd-47ad-b712-a2902f867792 +langcode: fr +status: true +dependencies: { } +id: '19125' +title: ZeDaily +api_key: null +secret_key: null +mapping_table: + - + simplenews_news: ze_daily_materio_ + contact_property: simplenews + newsletter_property_name: ZeDaily diff --git a/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.22839.yml b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.22839.yml new file mode 100644 index 0000000..8441c00 --- /dev/null +++ b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.22839.yml @@ -0,0 +1,13 @@ +uuid: 9a82ce3e-d5b1-4226-9e70-e4f2d28334ca +langcode: fr +status: true +dependencies: { } +id: '22839' +title: 'materio'' newsletter' +api_key: null +secret_key: null +mapping_table: + - + simplenews_news: materio_newsletter + contact_property: simplenews + newsletter_property_name: Newsletter diff --git a/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.24787.yml b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.24787.yml new file mode 100644 index 0000000..bd3536e --- /dev/null +++ b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.24787.yml @@ -0,0 +1,13 @@ +uuid: 494ab8bc-97f4-4e87-a9ac-876911d4d3a3 +langcode: fr +status: true +dependencies: { } +id: '24787' +title: Compagnie +api_key: null +secret_key: null +mapping_table: + - + simplenews_news: companies + contact_property: simplenews + newsletter_property_name: Companies diff --git a/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.24788.yml b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.24788.yml new file mode 100644 index 0000000..7cf8bd9 --- /dev/null +++ b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.24788.yml @@ -0,0 +1,9 @@ +uuid: 22d88999-43ab-4e59-8deb-02760e11f7ad +langcode: fr +status: true +dependencies: { } +id: '24788' +title: Test +api_key: null +secret_key: null +mapping_table: null diff --git a/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.drupal_simplenews.yml b/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.drupal_simplenews.yml deleted file mode 100644 index 1faad4f..0000000 --- a/config/sync/simplenews_mailjet_subscriptions.simplenews_mailjet_subsciption.drupal_simplenews.yml +++ /dev/null @@ -1,25 +0,0 @@ -uuid: 523a56dc-5643-427b-abfb-36bd04dc0376 -langcode: fr -status: true -dependencies: { } -id: drupal_simplenews -title: simplenews -api_key: cec52b4eb2d759f5372dfd194585c388 -secret_key: cec52b4eb2d759f5372dfd194585c388 -mapping_table: - - - simplenews_news: ze_daily_materio_ - contact_property: simplenews - newsletter_property_name: Daily - - - simplenews_news: materio_newsletter - contact_property: simplenews - newsletter_property_name: Newsletter - - - simplenews_news: companies - contact_property: simplenews - newsletter_property_name: Compagnie - - - simplenews_news: test - contact_property: simplenews - newsletter_property_name: Test diff --git a/patches/simplenews_mailjet_subscriptions__usingmailjetmodule.patch b/patches/simplenews_mailjet_subscriptions__usingmailjetmodule.patch index 90801ad..6ca50a0 100644 --- a/patches/simplenews_mailjet_subscriptions__usingmailjetmodule.patch +++ b/patches/simplenews_mailjet_subscriptions__usingmailjetmodule.patch @@ -1,3 +1,15 @@ +diff --git a/README.txt b/README.txt +index cee6e1a..b488e91 100644 +--- a/README.txt ++++ b/README.txt +@@ -15,6 +15,7 @@ REQUIREMENTS + This module requires the following modules: + + * Simplenews (https://www.drupal.org/project/simplenews) ++ * Mailet (https://www.drupal.org/project/Mailjet) + + INSTALLATION + ------------ diff --git a/simplenews_mailjet_subscriptions.info.yml b/simplenews_mailjet_subscriptions.info.yml index 2512a39..d4b0440 100644 --- a/simplenews_mailjet_subscriptions.info.yml @@ -75,6 +87,269 @@ index 0000000..cdd4137 + simplenews_mailjet_subscriptions.utilities: + class: Drupal\simplenews_mailjet_subscriptions\SimplenewsMailjetSubscriptionsUtilities + arguments: [ '@mailjet.handler' ] +diff --git a/src/Entity/SimplenewsMailjetSubscriptionEntity.php b/src/Entity/SimplenewsMailjetSubscriptionEntity.php +index 27b7737..b74f89e 100644 +--- a/src/Entity/SimplenewsMailjetSubscriptionEntity.php ++++ b/src/Entity/SimplenewsMailjetSubscriptionEntity.php +@@ -94,53 +94,53 @@ class SimplenewsMailjetSubscriptionEntity extends ConfigEntityBase implements Si + return $this->get('id'); + } + +- /** +- * Returns the entity api key. +- * +- * @return string +- * The entity api key. +- */ +- public function getApiKey() { +- return $this->get('api_key'); +- } +- +- /** +- * Sets the entity api key. +- * +- * @param string $api_key +- * Api key. +- * +- * @return $this +- * The Simplenews Mailjet Subscription entity. +- */ +- public function setApiKey($api_key) { +- $this->set('api_key', $api_key); +- return $this; +- } +- +- /** +- * Returns the entity secret key. +- * +- * @return string +- * The entity secret key. +- */ +- public function getSecretkey() { +- return $this->get('secret_key'); +- } +- +- /** +- * Sets the entity secret key. +- * +- * @param string $secret_key +- * Secret key. +- * +- * @return $this +- * The Simplenews Mailjet Subscription entity. +- */ +- public function setSecretkey($secret_key) { +- $this->set('secret_key', $secret_key); +- return $this; +- } ++ // /** ++ // * Returns the entity api key. ++ // * ++ // * @return string ++ // * The entity api key. ++ // */ ++ // public function getApiKey() { ++ // return $this->get('api_key'); ++ // } ++ ++ // /** ++ // * Sets the entity api key. ++ // * ++ // * @param string $api_key ++ // * Api key. ++ // * ++ // * @return $this ++ // * The Simplenews Mailjet Subscription entity. ++ // */ ++ // public function setApiKey($api_key) { ++ // $this->set('api_key', $api_key); ++ // return $this; ++ // } ++ ++ // /** ++ // * Returns the entity secret key. ++ // * ++ // * @return string ++ // * The entity secret key. ++ // */ ++ // public function getSecretkey() { ++ // return $this->get('secret_key'); ++ // } ++ ++ // /** ++ // * Sets the entity secret key. ++ // * ++ // * @param string $secret_key ++ // * Secret key. ++ // * ++ // * @return $this ++ // * The Simplenews Mailjet Subscription entity. ++ // */ ++ // public function setSecretkey($secret_key) { ++ // $this->set('secret_key', $secret_key); ++ // return $this; ++ // } + + /** + * Sets the entity mapping table. +diff --git a/src/Form/SimplenewsMailjetSubscriptionAddForm.php b/src/Form/SimplenewsMailjetSubscriptionAddForm.php +index 836bee3..bc70090 100644 +--- a/src/Form/SimplenewsMailjetSubscriptionAddForm.php ++++ b/src/Form/SimplenewsMailjetSubscriptionAddForm.php +@@ -64,20 +64,20 @@ class SimplenewsMailjetSubscriptionAddForm extends EntityForm { + 'exists' => [$this, 'exist'], + ], + ]; +- $form['api_key'] = [ +- '#type' => 'textfield', +- '#title' => $this->t('API Key'), +- '#maxlength' => 32, +- '#description' => $this->t('Mailjet Account API Key'), +- '#required' => TRUE, +- ]; +- $form['secret_key'] = [ +- '#type' => 'password', +- '#title' => $this->t('Secret Key'), +- '#maxlength' => 32, +- '#description' => $this->t('Mailjet Account Secret Key'), +- '#required' => TRUE, +- ]; ++ // $form['api_key'] = [ ++ // '#type' => 'textfield', ++ // '#title' => $this->t('API Key'), ++ // '#maxlength' => 32, ++ // '#description' => $this->t('Mailjet Account API Key'), ++ // '#required' => TRUE, ++ // ]; ++ // $form['secret_key'] = [ ++ // '#type' => 'password', ++ // '#title' => $this->t('Secret Key'), ++ // '#maxlength' => 32, ++ // '#description' => $this->t('Mailjet Account Secret Key'), ++ // '#required' => TRUE, ++ // ]; + + return $form; + } +diff --git a/src/Form/SimplenewsMailjetSubscriptionEditForm.php b/src/Form/SimplenewsMailjetSubscriptionEditForm.php +index 98342b5..f67ba96 100644 +--- a/src/Form/SimplenewsMailjetSubscriptionEditForm.php ++++ b/src/Form/SimplenewsMailjetSubscriptionEditForm.php +@@ -76,20 +76,20 @@ class SimplenewsMailjetSubscriptionEditForm extends EntityForm { + '#help' => $this->t('Configuration title'), + '#required' => TRUE, + ]; +- $form['api_key'] = [ +- '#type' => 'textfield', +- '#title' => $this->t('API Key'), +- '#maxlength' => 32, +- '#default_value' => $this->entity->getApiKey(), +- '#help' => $this->t('Mailjet Account API Key'), +- '#required' => TRUE, +- '#disabled' => !$this->entity->isNew(), +- ]; +- +- if ($this->entity->getApiKey() && $this->entity->getSecretkey()) { ++ // $form['api_key'] = [ ++ // '#type' => 'textfield', ++ // '#title' => $this->t('API Key'), ++ // '#maxlength' => 32, ++ // '#default_value' => $this->entity->getApiKey(), ++ // '#help' => $this->t('Mailjet Account API Key'), ++ // '#required' => TRUE, ++ // '#disabled' => !$this->entity->isNew(), ++ // ]; ++ ++ // if ($this->entity->getApiKey() && $this->entity->getSecretkey()) { + $this->constructTable($form, $form_state); + +- } ++ // } + + $form['add_subscription'] = [ + '#type' => 'submit', +diff --git a/src/SimplenewsMailjetSubscriptionsInterface.php b/src/SimplenewsMailjetSubscriptionsInterface.php +index c727d26..37c082d 100644 +--- a/src/SimplenewsMailjetSubscriptionsInterface.php ++++ b/src/SimplenewsMailjetSubscriptionsInterface.php +@@ -36,43 +36,43 @@ interface SimplenewsMailjetSubscriptionsInterface extends ConfigEntityInterface + */ + public function getId(); + +- /** +- * Returns the entity api key. +- * +- * @return string +- * The entity api key. +- */ +- public function getApiKey(); ++ // /** ++ // * Returns the entity api key. ++ // * ++ // * @return string ++ // * The entity api key. ++ // */ ++ // public function getApiKey(); + +- /** +- * Sets the entity api key. +- * +- * @param string $api_key +- * Api key. +- * +- * @return $this +- * The Simplenews Mailjet Subscription entity. +- */ +- public function setApiKey($api_key); ++ // /** ++ // * Sets the entity api key. ++ // * ++ // * @param string $api_key ++ // * Api key. ++ // * ++ // * @return $this ++ // * The Simplenews Mailjet Subscription entity. ++ // */ ++ // public function setApiKey($api_key); + +- /** +- * Returns the entity secret key. +- * +- * @return string +- * The entity secret key. +- */ +- public function getSecretkey(); ++ // /** ++ // * Returns the entity secret key. ++ // * ++ // * @return string ++ // * The entity secret key. ++ // */ ++ // public function getSecretkey(); + +- /** +- * Sets the entity secret key. +- * +- * @param string $secret_key +- * Secret key. +- * +- * @return $this +- * The Simplenews Mailjet Subscription entity. +- */ +- public function setSecretkey($secret_key); ++ // /** ++ // * Sets the entity secret key. ++ // * ++ // * @param string $secret_key ++ // * Secret key. ++ // * ++ // * @return $this ++ // * The Simplenews Mailjet Subscription entity. ++ // */ ++ // public function setSecretkey($secret_key); + + /** + * Sets the entity mapping table. diff --git a/src/SimplenewsMailjetSubscriptionsUtilities.php b/src/SimplenewsMailjetSubscriptionsUtilities.php index 950ff8a..05601ca 100644 --- a/src/SimplenewsMailjetSubscriptionsUtilities.php