sofn-xyz / mailing

Build, test, send emails with React
https://www.mailing.run
MIT License
3.6k stars 74 forks source link

Add subject to /api/render response #470

Closed gpsamson closed 1 year ago

gpsamson commented 1 year ago

Describe your changes

This pull request updates the /api/render endpoint to return the template's subject if it exists. It also fixes an issue where MJML render errors were not being returned under the mjmlErrors property as described in https://www.mailing.run/docs/rest-api#api-render.

Checklist before requesting a review

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 071e5f7e003ef269acec863fb63b1daf934a3024

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 1 year ago

@gpsamson is attempting to deploy a commit to the sofn Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mailing-dynamic-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2023 5:51pm
web-emails ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2023 5:51pm
1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **mailing-web** | ⬜️ Ignored ([Inspect](https://vercel.com/sofn/mailing-web/jRMEP4uveXoZ6j4ZgR39uzm93dUq)) | [Visit Preview](https://mailing-web-git-fork-gpsamson-gps-render-subject-sofn.vercel.app) | | May 31, 2023 5:51pm |
psugihara commented 1 year ago

Love it! Can you add a test? I think this would be a good spot: https://github.com/sofn-xyz/mailing/blob/main/packages/cli/src/pages/api/__integration__/render.test.ts

gpsamson commented 1 year ago

Love it! Can you add a test? I think this would be a good spot: https://github.com/sofn-xyz/mailing/blob/main/packages/cli/src/pages/api/__integration__/render.test.ts

Sure thing! Expanded the test in https://github.com/sofn-xyz/mailing/pull/470/commits/766d326b15c9607639d9c8e6c0b6352469382b0d and fixed a piece.

Thanks

psugihara commented 1 year ago

Beautiful, thanks so much! I'll add a patch changeset in main.