Insert content programmatically

Created on 21 December 2016, over 8 years ago
Updated 9 July 2025, 3 days ago

Hey! Awesome module! I'm trying to programmatically create a campaign and populate it.

I've got the following happening:

<?php
    // Making and sending a campaign.
    $content['std_content00'] = email_markup($parameters);
    $template_id = variable_get('email_template_id', 53911);
    $campaign_id = mailchimp_campaign_save_campaign($content, $list, $settings, $template_id);

The system works, the campaign is created, the list is associated and the campaign can be sent, but the content I'm providing is nowhere to be seen.

The template is the absolute default 'Code Your Own' template with mc:edit="std_content00" front and centre.

I've looked at your save_campaign function and you can see I'm casting the content to the array, keyed for the section.

I'm happy to provide any info that would help. Thanks in advance for any insight.

Cheers!

πŸ’¬ Support request
Status

Closed: works as designed

Version

4.0

Component

General

Created by

πŸ‡¨πŸ‡¦Canada mcdoolz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024