Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(all): expand #1

Merged
merged 51 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0033b92
.gitignore editors
martsokha Apr 7, 2024
3595a25
.gitignore openapi gen
martsokha Apr 7, 2024
bce302d
services, meta, openapi gen types
martsokha Apr 7, 2024
9342bc4
api keys, tests
martsokha Apr 7, 2024
ed39137
api keys types
martsokha Apr 7, 2024
7934c1b
blocking
martsokha Apr 8, 2024
edd6884
base_url support
martsokha Apr 8, 2024
e84ac5f
restore config.toml, must_use, inline
martsokha Apr 8, 2024
6807f0e
the rest
martsokha Apr 11, 2024
84ac97f
update docs, builder
martsokha Apr 11, 2024
5a9e7ac
support user-agent
martsokha Apr 11, 2024
6e7b231
dependabot.yaml
martsokha Apr 11, 2024
d5d0229
example, readme, typo
martsokha Apr 11, 2024
c61aa2b
error type
martsokha Apr 12, 2024
b7d1f61
before maybe_async
martsokha Apr 12, 2024
c1ef2b7
folder mods
martsokha Apr 12, 2024
231bfb9
error handling for the rest
martsokha Apr 12, 2024
d9ea634
example, docs, rem tokio
martsokha Apr 12, 2024
f6285c6
revert rem tokio
martsokha Apr 12, 2024
f674cfd
docs, types
martsokha Apr 14, 2024
51874b6
types, contacts test
martsokha Apr 14, 2024
f390301
Fix doctest
AntoniosBarotsis Apr 14, 2024
f4706c8
Temporarily fix test rate limits
AntoniosBarotsis Apr 14, 2024
c3e6a23
Add resend api key
AntoniosBarotsis Apr 14, 2024
ccf9bd4
Fix key
AntoniosBarotsis Apr 14, 2024
fc8ed42
types
martsokha Apr 15, 2024
e83e10e
Merge remote-tracking branch 'origin/main2' into main2
martsokha Apr 15, 2024
a4f014f
id types
martsokha Apr 15, 2024
fdb10be
contactid new, typo
martsokha Apr 15, 2024
cf3cb49
feature time, renames, docs
martsokha Apr 15, 2024
79df52e
revert region, rem time
martsokha Apr 16, 2024
0406826
rem feat time, rem domainreply, fix email
martsokha Apr 17, 2024
5ab313b
rem time
martsokha Apr 17, 2024
3212abe
cargo fmt
martsokha Apr 18, 2024
53fac63
rate limit, rename svc
martsokha Apr 26, 2024
814dddb
pedantic
martsokha Apr 26, 2024
b5b9422
revert config::send
martsokha Apr 26, 2024
49973fc
env var RESEND_RATE_LIMIT
martsokha Apr 27, 2024
028bc99
fmt, clippy
martsokha Apr 27, 2024
d07ff94
typo, String to &str
martsokha Apr 27, 2024
e269b99
clippy pedantic
martsokha Apr 27, 2024
139e3f0
rate limit test
martsokha Apr 27, 2024
389f741
rem print, import
martsokha Apr 27, 2024
6209ba8
rem limit
martsokha Apr 28, 2024
8edca52
consts
martsokha Apr 28, 2024
8e90941
docs, fix contacts::delete_by_*
martsokha Apr 29, 2024
d6504c2
oops
martsokha Apr 29, 2024
cb70dcc
Update email (oops)
AntoniosBarotsis Apr 30, 2024
220a801
Run clippy on all features again
AntoniosBarotsis Apr 30, 2024
f1ff555
Ignore some warnings
AntoniosBarotsis Apr 30, 2024
6c23134
Add v0.4.0
AntoniosBarotsis Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 0 additions & 123 deletions .cargo/config.toml

This file was deleted.

17 changes: 12 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# OS
Thumbs.db
.DS_Store
*.pdb

# Editors
.vs/
.vscode/
.idea/
.fleet/

# Generated by Cargo
# will have compiled files and executables
debug/
target/

gen/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock


# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- ## [Unreleased] -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a before-after conversion similar to what I had in v0.3. Since there was just 1 method before this PR this should be easy. I have a code example here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The weird formatting is a result of me using deno fmt for markdown files.
I'm a bit confused, do you want an example in the client documentation?

Copy link
Collaborator

@AntoniosBarotsis AntoniosBarotsis Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Github likes showing 6 lines minimum because I specifically selected the "unreleased" line. Meant to add an example similar to this:
image

for the "hello world" example I had in the repo before, in case anyone that was using the crate already wants to upgrade. I can add this myself as well.


## [0.3.0] - 2024-02-06

### Changed

- `Mail::new` now accepts a list of `to` addresses and thus supports sending an email to multiple
recipients.
- `Mail::new` now accepts a list of `to` addresses and thus supports sending an
email to multiple recipients.

```rs
// Before:
Expand Down
36 changes: 29 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
# https://doc.rust-lang.org/cargo/reference/manifest.html

[package]
name = "resend-rs"
description = "A very minimal Resend client for sending emails."
version = "0.3.0"
version = "0.4.0"
edition = "2021"
repository = "https://github.com/AntoniosBarotsis/resend-rs"
license = "GPL-3.0"
readme = "./README.md"

authors = ["Antonios Barotsis <[email protected]>"]
repository = "https://github.com/AntoniosBarotsis/resend-rs"
homepage = "https://github.com/AntoniosBarotsis/resend-rs"
documentation = "https://docs.rs/resend-rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
categories = ["email", "web-programming"]
keywords = ["email", "resend"]
description = "A minimal Resend client."

[package.metadata.docs.rs]
all-features = false
rustdoc-args = ["--cfg", "docsrs"]
martsokha marked this conversation as resolved.
Show resolved Hide resolved

[features]
async = []
default = ["native-tls"]

blocking = ["reqwest/blocking"]
rustls-tls = ["reqwest/rustls-tls"]
native-tls = ["reqwest/native-tls"]

[dependencies]
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "blocking"] }
thiserror = "1.0.43"
reqwest = { version = "0.12.3", default-features = false, features = ["json"] }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = { version = "1.0.115", features = [] }
thiserror = { version = "1.0.58", features = [] }
url = { version = "2.5.0", features = [] }

[dev-dependencies]
tokio = { version = "1.37.0", features = ["macros", "test-util"] }
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,33 @@
[![Crates.io](https://img.shields.io/crates/v/resend-rs)](https://crates.io/crates/resend-rs)
[![docs.rs](https://img.shields.io/docsrs/resend-rs)](https://docs.rs/resend-rs)

A *very* minimal [Resend](https://resend.com) client for sending emails.
A minimal [Resend](https://resend.com) client for sending emails.

Emails are sent via the [`resend_client::ResendClient`] which provides both a synchronous and
asynchronous send method. The two are mutually exclusive and accessible via the `async` feature. The
crate uses [`reqwest`](https://github.com/seanmonstar/reqwest) internally.
Emails are sent via the [`Resend`] client which provides both a
martsokha marked this conversation as resolved.
Show resolved Hide resolved
synchronous and asynchronous send method. The two are mutually exclusive and
accessible via the `blocking` feature. The crate uses
[`reqwest`](https://github.com/seanmonstar/reqwest) internally.

Currently, this only supports the `html` Resend parameter as I built this for my own use and
that's all I need. If anyone else is looking into this, however, I would not mind expanding it.
Currently, this only supports the `html` Resend parameter as I built this for my
own use and that's all I need. If anyone else is looking into this, however, I
would not mind expanding it.

#### Features

- `blocking` to enable the blocking client.
- `native-tls` to use system-native TLS. **Enabled by default**.
- `rustls-tls` to use TLS backed by rustls .

#### Examples

```rust
use resend_rs::{Resend, Result};

#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new();
let _ = resend.emails.send().await?;

Ok(())
}
```
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
tab_spaces = 2
# tab_spaces = 2
edition ="2021"
Loading