pub struct BulkLettersResource<'a> { /* private fields */ }Expand description
client.bulk_letters()
Implementations§
Source§impl<'a> BulkLettersResource<'a>
impl<'a> BulkLettersResource<'a>
Sourcepub fn create(&self, body: &BulkletterCreate) -> Result<BulkletterCreated>
pub fn create(&self, body: &BulkletterCreate) -> Result<BulkletterCreated>
Create a bulkletter
POST /bulkletters
Schedules a mail-merge rendering job and starts the worker in the background. Requires edit bulkletter permission and access to the selected HTML template. Returns HTTP 200 with only {id}, plus a Location header for the job; it does not return the job object or finished PDF. Poll that URL until the job is DONE and has fileId/url. The final download is a ZIP containing individual PDFs. groupByHousehold groups exact addresses rather than family relationships.
§Example
let body = models::BulkletterCreate {
content: "<p>Hello [Spitzname]!</p>".into(),
group_by_household: true,
html_template_id: 39,
name: "Newsletter April 2025".into(),
person_ids: vec![13, 14],
..Default::default()
};
let result = client.bulk_letters().create(&body)?;
println!("{}", result.id);Sourcepub fn delete(&self, id: impl Display) -> Result<()>
pub fn delete(&self, id: impl Display) -> Result<()>
Delete bulkletter
DELETE /bulkletters/{id}
Deletes the mail-merge job, its recipient rows, temporary rendering directory and generated ZIP file. Requires edit bulkletter permission and the same owner restriction as the detail read. No dry-run mode is supported. The operation does not coordinate with a currently running renderer.
§Example
client.bulk_letters().delete(36)?;Sourcepub fn execute(&self, body: &BTreeMap<String, Value>) -> Result<()>
pub fn execute(&self, body: &BTreeMap<String, Value>) -> Result<()>
Execute pending bulkletter jobs
POST /bulkletters/execute
Internal worker entry point, normally started automatically after creation. Processes up to ten recipient rows of the first unfinished mail-merge job, then starts another background request while work remains. Operates across creators. It renders separate PDFs and packages them into a ZIP; it does not send mail. A recently active worker causes this request to do no work. Returns 204 regardless of whether processing was skipped or a rendering exception was recorded as job status ERROR; inspect the job status for the result.
§Example
let body: std::collections::BTreeMap<String, serde_json::Value> = Default::default();
client.bulk_letters().execute(&body)?;Sourcepub fn get(&self, id: impl Display) -> Result<Bulkletter>
pub fn get(&self, id: impl Display) -> Result<Bulkletter>
Get bulkletter
GET /bulkletters/{id}
Reads one mail-merge job as a bare object, without a data wrapper. Requires edit bulkletter permission. Only the creator’s jobs and jobs with created_pid=0 are visible; other owners are reported as 404. The final file is a ZIP archive, not a combined PDF.
§Example
let bulk_letter = client.bulk_letters().get(36)?;
println!("{}", bulk_letter.name);Sourcepub fn list(&self) -> Result<Vec<Bulkletter>>
pub fn list(&self) -> Result<Vec<Bulkletter>>
Get all bulkletters
GET /bulkletters
Lists the current user’s mail-merge jobs and jobs with created_pid=0. Requires edit bulkletter permission. Returns a bare array without data or meta; no pagination, status filter or ordering is defined.
§Example
for bulk_letter in client.bulk_letters().list()? {
println!("{}", bulk_letter.name);
}Sourcepub fn list_persons(&self, id: impl Display) -> Result<Vec<BulkletterReceiver>>
pub fn list_persons(&self, id: impl Display) -> Result<Vec<BulkletterReceiver>>
Get receivers of a bulkletter
GET /bulkletters/{id}/persons
Lists scheduled recipient persons whose person records the caller may view. Requires edit bulkletter or create print labels permission. Returns data only, without meta or pagination. Address fields reflect current person data. This endpoint does not apply the job-owner restriction of the detail read; a nonexistent job normally yields an empty list.
§Example
for person in client.bulk_letters().list_persons(36)? {
println!("{:?}", person.name);
}