Skip to content

A Rust client to send text-messages using Tigron's SMS-service

Notifications You must be signed in to change notification settings

NielDuysters/TigronSms-Rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

TigronSms-Rust

Description

This module allows you to send text messages using Tigron's SMS-API.

Installation

  1. Download the file tigron_sms.rs and include the module in your main.rs
  2. Append the dependencies in Cargo.toml to your project.

Requirements

  • A Tigron account and the purchased SMS product.
  • The Rust Language (2018 edition)
  • Tokio (v0.2)
  • An asynchronous project

Example

mod tigron_sms;

#[tokio::main]
async fn main() {
    let tigron_sms = tigron_sms::TigronSms {
        credentials: ("YOUR_TIGRON_USERNAME".to_string(), "YOUR_TIGRON_PASSWORD".to_string()),
    };

    let to = "+32.xxxxxxxxx".to_string();
    let from = "+32.xxxxxxxxx".to_string();
    let message = "Hello world!".to_string();

    if let Err(e) = tigron_sms.send(to, from, message).await {
        eprintln!("{}", e);
    }
}

Todo

  • Clean up code.
  • Documentation.
  • Input validation (telephone number must be in valid format, message length must be under 160,...)

About

A Rust client to send text-messages using Tigron's SMS-service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages