pastjean / postmark-rs Goto Github PK
View Code? Open in Web Editor NEWPostmark client for rust
Home Page: https://docs.rs/postmark
License: Apache License 2.0
Postmark client for rust
Home Page: https://docs.rs/postmark
License: Apache License 2.0
See comment here:
https://github.com/pastjean/postmark-rs/pull/13/files#r1314417921
I tried this code:
let req = SendEmailWithTemplateRequest::builder();
I expected to see this happen: exists/compiles
Instead, this happened:
--> crates/emailer/src/lib.rs:6:9
|
6 | SendEmailWithTemplateRequest,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `SendEmailWithTemplateRequest` in `api::email`
7 | TemplateModel,
| ^^^^^^^^^^^^^ no `TemplateModel` in `api::email`
I think the ability to send emails with templates was removed, possibly by accident? Seems like the file with the code is there, but the mod
and pub use
lines were removed.
Postmark 0.7.0 is posted on docs.rs, but I only see tags here on GitHub for 0.6.0. Which branch/commit is 0.7.0 coming from?
Is anyone working on the templates API? (https://postmarkapp.com/developer/api/templates-api)
If not, I believe I have a use case for that and would take a stab at it over the next couple of weeks.
Hey, it's a great crate! Congrats on this ๐ฏ
I'm using the crate, and now am wondering how to use Postmark's templates. Unfortunately, it's not yet supported by this client.
So, first github issue: can we add support for templates?
I tried this code:
cargo test
I expected to see this happen: Unit tests to pass
Instead, this happened: Multiple unit tests failed trying to flatten a string Enum.
rustc --version --verbose
:
rustc 1.68.2 (9eb3afe9e 2023-03-27)
binary: rustc
commit-hash: 9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0
commit-date: 2023-03-27
host: x86_64-unknown-linux-gnu
release: 1.68.2
LLVM version: 15.0.6
Currently SendEmailRequest::body setter supports setting either HTML body or text body, but not both for a single email. Setting both is supported by Postmark API - see example here.
I'm opening this issue because I ran into some trouble with manual testing. When I went to test my template changes against the API, using the skipped test, I have been hitting snags with sending any sort of request to the Postmark API.
The manual test in this branch can be run with cargo test --test send_email. I made the test match what is in the package docstrings pretty closely.
The error I am getting back from the .execute() call is:
thread 'send_email' panicked at 'called `Result::unwrap()` on an `Err` value: Client { source: Communication { source: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.postmarkapp.com")), port: None, path: "/email", query: None, fragment: None }, source: hyper::Error(Connect, "invalid URL, scheme is not http") } } }', tests/send_email.rs:37:10
The error message invalid URL, scheme is not http
can be traced to here: https://docs.rs/hyper/latest/src/hyper/client/connect/http.rs.html#285
This error will throw when the scheme is https. I'm not sure what is going on in the middle with reqwest and why it is expecting http, but it should pretty clearly be https to communicate with Postmark.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.