email-messages command lets you view and edit the email message attached to a campaign. Email messages are created automatically when you create a campaign.
Use this command when you want to keep email content in Git as .lmx files,
review changes locally, and push updates to a draft email message with revision
protection.
get
Get an email message by ID, including its current content and contentRevisionId.
update
Update fields on a draft email message. The owning campaign must be in Draft status.
Concurrency control
Every update must include either--expected-revision-id or --force:
--expected-revision-id— pass thecontentRevisionIdfrom a prioremail-messages get. The request is rejected with a conflict if the server’s revision has advanced, so you don’t overwrite a concurrent edit.--force— fetch the current revision automatically and use it. This overwrites any concurrent edits.
Setting content
Pass LMX inline with--lmx or from a file with --lmx-file:
Git workflow
For a safer file-based workflow:- Run
loops email-messages get <email-message-id>and save the current LMX in your repository. - Commit the
.lmxfile or review it in a branch. - Update the draft email with
--lmx-fileand the latest--expected-revision-id. - Save the returned
contentRevisionIdbefore making another update.
--force only when you intentionally want to overwrite the latest draft
content.
Flags
| Flag | Short | Description |
|---|---|---|
--expected-revision-id | -r | Last-seen contentRevisionId from email-messages get. Mutually exclusive with --force. |
--force | -f | Fetch the current revision and use it (overwrites concurrent edits). Mutually exclusive with --expected-revision-id. |
--subject | Email subject | |
--preview-text | Email preview text | |
--from-name | Sender display name | |
--from-email | Sender username (the part before @ — the team’s sending domain is appended automatically) | |
--reply-to | Reply-to email address | |
--lmx | LMX markup (inline). Mutually exclusive with --lmx-file. | |
--lmx-file | Path to a file containing LMX markup. Mutually exclusive with --lmx. |
--subject, --preview-text, --from-name, --from-email, --reply-to, --lmx, or --lmx-file) must be provided.
