notify_me/lib.rs
1//! A Rust library for sending notifications.
2//!
3//! Send notifications to email or communication software, such as WeChat.
4//! It is very suitable for developers to receive notifications of
5//! their software on mobile phones.
6//!
7//! ## Features
8//! - Send notifications to your email
9//! - Send notifications to your WeChat
10//!
11//! ## Example
12//! To use this library, add the following to your `Cargo.toml`:
13//! ```toml
14//! [dependencies]
15//! notify-me = "0.2"
16//! ```
17//!
18//! ### Send notifications to WeChat
19//!
20//! Note that, this crate use [xtuis](https://xtuis.cn/) to implement WeChat notifications.
21//! Hence you have to first follow the WeChat official account of [xtuis](https://xtuis.cn/) and get the `token`.
22//!
23//! ```no_run
24//! use notify_me::{Notify, WechatNotifier};
25//!
26//! let notifier = WechatNotifier::new("your xtuis token").unwrap();
27//! notifier.notify("notification title", "notification content").unwrap();
28//! ```
29//!
30//! ### Send notifications to email
31//!
32//! ```no_run
33//! use notify_me::{Notify, EmailNotifier};
34//!
35//! let notifier = EmailNotifier::new("smtp_host", "smtp_username", "smtp_password", "recipient").unwrap();
36//! notifier.notify("notification title", "notification content").unwrap();
37//! ```
38mod notifier;
39
40pub use notifier::email_notifier::EmailNotifier;
41pub use notifier::wechat_notifier::WechatNotifier;
42pub use notifier::Notify;