#flows #send-email #sendgrid #networking #flow #integration #subject

sendgrid-flows

SendGrid integration for flows.network

3 releases

0.1.2 Mar 3, 2023
0.1.1 Feb 23, 2023
0.1.0 Feb 23, 2023

#222 in Email

33 downloads per month

MIT/Apache

6KB
60 lines

This is a library for integrating SendGrid in your flow function for flows.network.

Usage example

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.


lib.rs:

SendGrid integration for Flows.network

Quick Start

To get started, let's write a very tiny flow function.

use openai_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!["receiver@domain.com"],
            subject: "Hi",
            content: sm.text
        };
        send_email("sender@domain.com", email);
    });
}

When the Slack message is received, send email using [send_email].

Dependencies

~1–1.7MB
~40K SLoC