Skip to main content

BulkLettersResource

Struct BulkLettersResource 

Source
pub struct BulkLettersResource<'a> { /* private fields */ }
Expand description

client.bulk_letters()

Implementations§

Source§

impl<'a> BulkLettersResource<'a>

Source

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);
Source

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)?;
Source

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)?;
Source

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);
Source

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);
}
Source

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);
}

Trait Implementations§

Source§

impl<'a> Clone for BulkLettersResource<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for BulkLettersResource<'a>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more