Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d5e10857d
|
||
|
|
70f5261b49
|
@@ -7,7 +7,7 @@ pub async fn send_mssage(
|
|||||||
contact: &textsender_models::contact::Contact,
|
contact: &textsender_models::contact::Contact,
|
||||||
param: crate::twilio::types::Parameters,
|
param: crate::twilio::types::Parameters,
|
||||||
config: &textsender_models::config::auxiliary::TwilioConfig,
|
config: &textsender_models::config::auxiliary::TwilioConfig,
|
||||||
) -> Result<crate::twilio::api::types::TwilioAPIMessage, std::io::Error> {
|
) -> Result<reqwest::Response, std::io::Error> {
|
||||||
if config.account_sid.is_empty() {
|
if config.account_sid.is_empty() {
|
||||||
Err(std::io::Error::other("Account SID is empty"))
|
Err(std::io::Error::other("Account SID is empty"))
|
||||||
} else if config.auth_token.is_empty() {
|
} else if config.auth_token.is_empty() {
|
||||||
@@ -72,6 +72,8 @@ pub async fn send_mssage(
|
|||||||
|
|
||||||
match request.send().await {
|
match request.send().await {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
|
Ok(response)
|
||||||
|
/*
|
||||||
match response
|
match response
|
||||||
.json::<crate::twilio::api::types::TwilioAPIMessage>()
|
.json::<crate::twilio::api::types::TwilioAPIMessage>()
|
||||||
.await
|
.await
|
||||||
@@ -79,7 +81,6 @@ pub async fn send_mssage(
|
|||||||
Ok(resp) => Ok(resp),
|
Ok(resp) => Ok(resp),
|
||||||
Err(err) => Err(std::io::Error::other(err)),
|
Err(err) => Err(std::io::Error::other(err)),
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
match response.text().await {
|
match response.text().await {
|
||||||
Ok(body) => {
|
Ok(body) => {
|
||||||
let mut obj = crate::twilio::api::types::TwilioAPIMessage {
|
let mut obj = crate::twilio::api::types::TwilioAPIMessage {
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
// Things needed to send a message
|
/// Parameters - Controls flow of sending message
|
||||||
// Contact - Receipient to send to (textsender-models)
|
|
||||||
// Message - The content to sent (textsender-models)
|
|
||||||
// Parameters - Controls flow of sending message
|
|
||||||
// Config - Contains info needed to send message (textsender-models)
|
|
||||||
pub struct Parameters {
|
pub struct Parameters {
|
||||||
pub schedule: bool,
|
pub schedule: bool,
|
||||||
pub schedule_at: Option<time::OffsetDateTime>,
|
pub schedule_at: Option<time::OffsetDateTime>,
|
||||||
|
|||||||
Reference in New Issue
Block a user