🇫🇷France @thomas-at-passerelle

Account created on 6 April 2021, over 3 years ago
#

Recent comments

🇫🇷France thomas-at-passerelle

The second issue was just like creating a node

      $campaign_id = mailchimp_campaign_save_campaign($template_content, $recipients, $settings, NULL);
      if (empty($campaign_id)) {
        $this->messenger()->addMessage(t('An error occurred while saving this campaign to MailChimp service.'), 'error');
      }
      else {
        // Create campaign entity and save
        $campaign = \Drupal::entityTypeManager()->getStorage('mailchimp_campaign')->create();
        $campaign->setMcCampaignId($campaign_id);
        $campaign->setTemplate($template_content);
        $campaign->save();
      }
Production build 0.71.5 2024