pub struct SendSmsRequest {
pub phone_number_set: Vec<String>,
pub sms_sdk_app_id: String,
pub template_id: String,
pub sign_name: Option<String>,
pub template_param_set: Option<Vec<String>>,
pub extend_code: Option<String>,
pub session_context: Option<String>,
pub sender_id: Option<String>,
}
Expand description
Request structure for sending SMS
Fields§
§phone_number_set: Vec<String>
List of phone numbers to send SMS to Format: +[country code][phone number] Example: +8613800000000 Maximum 200 phone numbers per request
sms_sdk_app_id: String
SMS SDK App ID You can view it in the SMS console
template_id: String
Template ID You must use an approved template ID
sign_name: Option<String>
SMS signature content You must use an approved signature Required for domestic SMS, optional for international SMS
template_param_set: Option<Vec<String>>
Template parameters The number of parameters must match the template variables
extend_code: Option<String>
SMS extension code Default is not enabled
session_context: Option<String>
User session context Server will return this as-is
sender_id: Option<String>
SenderId for international SMS Required for international SMS with independent SenderId
Implementations§
Source§impl SendSmsRequest
impl SendSmsRequest
Sourcepub fn new<S: Into<String>>(
phone_number_set: Vec<String>,
sms_sdk_app_id: S,
template_id: S,
sign_name: S,
template_param_set: Vec<String>,
) -> Self
pub fn new<S: Into<String>>( phone_number_set: Vec<String>, sms_sdk_app_id: S, template_id: S, sign_name: S, template_param_set: Vec<String>, ) -> Self
Create a new SendSmsRequest with required parameters
§Arguments
phone_number_set
- List of phone numberssms_sdk_app_id
- SMS SDK App IDtemplate_id
- Template IDsign_name
- SMS signaturetemplate_param_set
- Template parameters
§Examples
use tencentcloud_sms_sdk::SendSmsRequest;
let request = SendSmsRequest::new(
vec!["+8613800000000".to_string()],
"1400000000",
"123456",
"YourSignature",
vec!["123456".to_string()],
);
Sourcepub fn new_international<S: Into<String>>(
phone_number_set: Vec<String>,
sms_sdk_app_id: S,
template_id: S,
template_param_set: Vec<String>,
) -> Self
pub fn new_international<S: Into<String>>( phone_number_set: Vec<String>, sms_sdk_app_id: S, template_id: S, template_param_set: Vec<String>, ) -> Self
Create a new SendSmsRequest for international SMS
Sourcepub fn set_sign_name<S: Into<String>>(&mut self, sign_name: S) -> &mut Self
pub fn set_sign_name<S: Into<String>>(&mut self, sign_name: S) -> &mut Self
Set the SMS signature
Sourcepub fn set_template_param_set(&mut self, params: Vec<String>) -> &mut Self
pub fn set_template_param_set(&mut self, params: Vec<String>) -> &mut Self
Set template parameters
Sourcepub fn set_extend_code<S: Into<String>>(&mut self, extend_code: S) -> &mut Self
pub fn set_extend_code<S: Into<String>>(&mut self, extend_code: S) -> &mut Self
Set extension code
Sourcepub fn set_session_context<S: Into<String>>(
&mut self,
session_context: S,
) -> &mut Self
pub fn set_session_context<S: Into<String>>( &mut self, session_context: S, ) -> &mut Self
Set session context
Sourcepub fn set_sender_id<S: Into<String>>(&mut self, sender_id: S) -> &mut Self
pub fn set_sender_id<S: Into<String>>(&mut self, sender_id: S) -> &mut Self
Set sender ID for international SMS
Trait Implementations§
Source§impl Clone for SendSmsRequest
impl Clone for SendSmsRequest
Source§fn clone(&self) -> SendSmsRequest
fn clone(&self) -> SendSmsRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more