tencentcloud-sdk-sms-wasi

Crates.iotencentcloud-sdk-sms-wasi
lib.rstencentcloud-sdk-sms-wasi
version0.2.1
sourcesrc
created_at2023-12-23 14:15:26.175537
updated_at2023-12-23 14:15:26.175537
descriptiontencent cloud sms rust sdk
homepage
repositoryhttps://github.com/flows-network/tencent-sdk-sms
max_upload_size
id1079142
size53,929
DarumaDocker!! (DarumaDocker)

documentation

README

Tencent Cloud sms rust sdk

version: 2021-01-11

signature: v3

Examples

    // prepare param
    let secret_id = "your secret_id";
    let secret_key = "your secret_key";
    let sms_sdk_app_id = "your sms_sdk_app_id";
    let template_id = "your template_id";
    let sign_name = "your sign_name";
    let region = "ap-guangzhou";
    let phone_number_set = vec!["+86".to_owned()];
    let template_param_set = vec!["123456".to_owned()];
    // build client
    let credential = Credential::new(secret_id, secret_key, None);
    let client = Client::new(credential, region);
    // build request
    let request = SendSmsRequest::new(
        phone_number_set.clone(),
        sms_sdk_app_id,
        template_id,
        sign_name,
        template_param_set,
    );
    // send
    let response = client.send_sms(request).await;
    // check
    match response {
        Ok(res) => {
            phone_number_set.into_iter().for_each(|phone_number| {
                println!(
                    "send {}: {:?}",
                    phone_number,
                    res.check_is_success(phone_number.to_owned())
                );
            });
        }
        Err(e) => {
            println!("send error: {}", e);
        }
    }
Commit count: 0

cargo fmt