Magidoc

draftCampaignEmailsForRows
Mutation

Drafts campaign emails for the people in the given table rows. Each draft is written for the campaign's goal and personalised with what the table knows about the person: their Campaign Score with the metrics and research behind it, and their research columns. Rows without a campaign recipient get a planned one first. Rows for people held from outreach, without an email, or already drafting are skipped and reported. Nothing is sent: drafts wait in the campaign's Emails tab. Access: caller must have CRM access to the campaign workspace. emailTemplate and emailRules are alternative drafting methods. Passing one saves it and clears the other; every draft then follows the selected method. followUps sets the campaign's sequence first: the follow-up steps after the first email, in order, each with its wait and its own writing brief. Each person's email for every step is then drafted with their first email, the same way, and reviewed with it in the Emails tab. Launching a person's first email approves their follow-ups; each goes as a reply in the same thread once its wait has passed, on a weekday, and none goes after the person replies, books a meeting, opts out or bounces. Steps left out of followUps are deleted (sends that went out stay); [] removes them all; omit followUps to keep the current steps, which are drafted too. With senderMode (self or account_owners), it is saved as the campaign's emailSenderMode first. Drafts send from the campaign's emailSenderMode: account_owners sends each from the owner of the person's account, who reviews and sends it; anyone else sends from the caller. Errors: missing campaign, no table, more than 100 rows, fixed_user as senderMode, exhausted Buzz AI credits, more than 10 follow-up steps, an unknown followUpId, a delay outside 1 to 60, or a step without generationInstructions.

Arguments

#

campaignId

ID !
Non-null

plannedSendDay

Intended Eastern send day, YYYY-MM-DD. This does not schedule or launch email.

recordIds

[ID !]!
Non-null

Response

#

Returns DraftCampaignEmailsResult !.

Example

#