Crates.io | sendgrid-flows |
lib.rs | sendgrid-flows |
version | 0.1.2 |
source | src |
created_at | 2023-02-23 07:22:44.929633 |
updated_at | 2023-03-03 08:19:52.181814 |
description | SendGrid integration for flows.network |
homepage | |
repository | |
max_upload_size | |
id | 792380 |
size | 5,401 |
This is a library for integrating SendGrid in your flow function for flows.network.
use sendgrid_flows::{Email, send_email};
use slack_flows::{listen_to_channel};
#[no_mangle]
pub fn run() {
listen_to_channel("myworkspace", "mychannel", |sm| {
let email = Email {
to: vec![String::from("receiver@domain.com")],
subject: String::from("Hi"),
content: sm.text
};
send_email("sender@domain.com", &email);
});
}
When a new message is received from mychannel
, we will send an email using send_email
.
The whole document is here.