NOTE: THIS PROJECT IS NOT CURRENTLY IN CRATES.IO
This is the Blazingly Fast (not really) SDK for novu. This SDK should be used in your server-side code. π
You need to add the Currently not possible.novu
dependency to your Cargo.toml
. This can be done with cargo add novu
.
We currently only support async/await.
// Here you create the instance
// If you're selfhosting, You can replace `None` with `Some("your selfhosted novu instance api url")`
let novu = Novu::new("<your api key>", None).unwrap();
let result = novu
.trigger(TriggerPayload {
name: "<your template name>".to_string(),
payload: HashMap::new(),
to: TriggerRecipientsType::Single(
TriggerRecipientBuilder::new("<your subscriber id>")
.first_name("<first name>") // Optional
.email("<email>") // Optional
.build(),
),
})
.await;
// Here you can handle the outcome.
match result {
Ok(event) => {
println!(
"Notification sent!!! \n\nack: {}\nstatus: {}\ntransaction_id: {}",
event.acknowledged, event.status, event.transaction_id
)
}
Err(api_error) => println!("An error occurred: {}", api_error),
}
<your api key>
with your api key<your template name>
with the template you want to use<your subscriber id>
with your subscriber idfirst_name, email, avatar, phone_number, last_name, etc
to the subscriberGlad that you want to contribute! π
Currently we don't have
CONTRIBUTION.md
orCODE_OF_CONDUCT.md
, but these will be created soonβ’
API Docs: docs.novu.co/api
For support, join Novu's Discord server or email me@midka.dev.