Skip to content

Use Mailchimp campaign config from format meta instead of env#1354

Merged
jstcki merged 6 commits intomainfrom
newsletter-config-in-format
Mar 12, 2026
Merged

Use Mailchimp campaign config from format meta instead of env#1354
jstcki merged 6 commits intomainfrom
newsletter-config-in-format

Conversation

@jstcki
Copy link
Copy Markdown
Contributor

@jstcki jstcki commented Mar 10, 2026

As the format meta is resolved anyway in the publish mutation, we can just put the MailChimp campaign configuration right there instead of using an env var.

This reduces the amount of API configuration necessary for adding newsletters and things like the sender name can be updated easily via Publikator. Also removes config lookup by the format's repo ID.

Newsletter settings are now editable in the Publikator Meta editor:

image

@jstcki
Copy link
Copy Markdown
Contributor Author

jstcki commented Mar 10, 2026

Note: I've tested creating a dynamic recipient filter by using just the interest category and group – this works but would require more configuration, so maybe let's just stick with the saved segments for now.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
admin-republik-ch Ready Ready Preview Mar 11, 2026 4:57pm
publikator-republik-ch Ready Ready Preview Mar 11, 2026 4:57pm
www-republik-love Ready Ready Preview Mar 11, 2026 4:57pm

Request Review

@annatraussnig
Copy link
Copy Markdown
Contributor

One note: I think ALL our newsletters are free at this point, so maybe the checkbox is not needed?

Copy link
Copy Markdown
Contributor

@annatraussnig annatraussnig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nice. I "tested" the publikator bit, not the E2E NL pipeline, but I assume you did.
Mini question: remembering the previous NL simplification PR, I would have expected it to be more code removed after this change (processing the CONFIGS object, etc), but I guess that's it.

value={newsletter?.fromName}
onChange={handleChange('fromName')}
/>
<Field
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do/can we add validation here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I've been hesitant to introduce more complexity since I'm not sure if we handle form errors well in Publikator but I can have a look.

value={newsletter?.replyTo}
onChange={handleChange('replyTo')}
/>
<Checkbox
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as i mentioned, i think all newsletters are free and this concept has been deprecated, but check with Henning

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super sure, e.g. the DAILY and WEEKLY newsletters never were configured like this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is a relic of pre-regwall era.

onInputChange={onInputChange}
format={titleData?.format?.meta}
/>
<NewsletterForm editor={editor} node={node} />
Copy link
Copy Markdown
Contributor

@annatraussnig annatraussnig Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would insert it much higher up in the form. It's only shown for formats and, for formats, it feels much more important than TTS or socials.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable, yes


if (!response.ok) {
const json = await response.json()
console.error(json)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.error intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of, because our error handling is extremely inconsistent. This way, at least there's something useful in the logs (the MailChimp API response sometimes contains detailed errors). I'm also throwing the json.detail and actually am using that in Publikator again, so if something goes wrong, people may be able to tell us what happened.

Copy link
Copy Markdown
Contributor

@hdahlheim hdahlheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No additions. LGTM

@jstcki jstcki merged commit 7e59c80 into main Mar 12, 2026
7 checks passed
@jstcki jstcki deleted the newsletter-config-in-format branch March 12, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants