pub struct HttpOutgoingSmsMessage {
pub to: String,
pub content: String,
pub validity_period: Option<u8>,
pub flash: Option<bool>,
pub timeout: Option<u32>,
}
Expand description
The outgoing SMS message to be sent to a target number.
Fields§
§to: String
The target phone number, this should be in international format.
content: String
The full message content. This will be split into multiple messages by the server if required. This also supports Unicode emojis etc.
validity_period: Option<u8>
The relative validity period to use for message sending. This determines how long the message should remain waiting while undelivered. By default, this is determined by the server (24 hours).
flash: Option<bool>
Should the SMS message be sent as a Silent class? This makes a popup show on the users device with the message content if they’re logged in.
timeout: Option<u32>
A timeout that should be applied to the entire request. If one is not set, the default timeout is used.
Implementations§
Source§impl HttpOutgoingSmsMessage
impl HttpOutgoingSmsMessage
Sourcepub fn simple_message(to: impl Into<String>, content: impl Into<String>) -> Self
pub fn simple_message(to: impl Into<String>, content: impl Into<String>) -> Self
Create a new outgoing message with a default validity period and no flash. The default validity period is applied by SMS-API, so usually 24 hours.
Sourcepub fn with_flash(self, flash: bool) -> Self
pub fn with_flash(self, flash: bool) -> Self
Set the message flash state. This will show a popup if the recipient is logged-in to their phone, otherwise as a normal text message.
Sourcepub fn with_validity_period(self, period: u8) -> Self
pub fn with_validity_period(self, period: u8) -> Self
Set a relative validity period value.
Sourcepub fn with_timeout(self, timeout: u32) -> Self
pub fn with_timeout(self, timeout: u32) -> Self
Set a request timeout value.
Trait Implementations§
Source§impl Clone for HttpOutgoingSmsMessage
impl Clone for HttpOutgoingSmsMessage
Source§fn clone(&self) -> HttpOutgoingSmsMessage
fn clone(&self) -> HttpOutgoingSmsMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more