Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Newsletter archiving - edit Letterhead API request to accept maximum amount of newsletters #1304

Description

@chelsea-tnc

Context: We have a deployment job that gets all newsletters for a site from the Letterhead API and saves them to the site's archive page. The LH API will return 10 results max, so if a site has more than 10 newsletters, only 10 are returned. We need to edit the query to get all newsletters. Ideally, when we switch to automated newsletter publishing (#1277), we should get the last N newsletters that were published since we last updated it and update the page with only what's changed.

Manual repro steps:

  1. Create a GET request to the LH API: https://api.tryletterhead.com/api/v2/channels/<CHANNEL_SLUG_GOES_HERE>/letters?api=true. You will need to use the LH API token for authorization and the channel slug for the specific site.
  2. Observe the size of the items list versus the total field. The total field includes all newsletters and welcome letters. However, items only shows 10 items. We need all items.

Suggested fix: LH suggested we set a large limit in the request to get all items (https://api.tryletterhead.com/api/v2/channels/<CHANNEL_SLUG_GOES_HERE>/letters?api=true&limit=999999).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions