Refactoring code
This commit is contained in:
+11
-5
@@ -100,12 +100,18 @@ pub mod endpoint {
|
|||||||
schedule_at: None,
|
schedule_at: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut sendmsg = swoosh::SendMsg::default();
|
||||||
|
sendmsg.load_config(
|
||||||
|
&t_config.auth_token,
|
||||||
|
&t_config.phone_number,
|
||||||
|
&t_config.service_sid,
|
||||||
|
&t_config.account_sid,
|
||||||
|
);
|
||||||
|
|
||||||
for contact in &contacts {
|
for contact in &contacts {
|
||||||
match swoosh::twilio::api::send_message(
|
sendmsg.load_message(&message.content);
|
||||||
&message, contact, &pp, &t_config,
|
sendmsg.load_recipient(&contact.phone_number);
|
||||||
)
|
match sendmsg.send_message(&pp).await {
|
||||||
.await
|
|
||||||
{
|
|
||||||
Ok(result) => {
|
Ok(result) => {
|
||||||
let val = swoosh::twilio::api::response_to_json(result).await;
|
let val = swoosh::twilio::api::response_to_json(result).await;
|
||||||
let mer = textsender_models::message::event::MessageEventResponse {
|
let mer = textsender_models::message::event::MessageEventResponse {
|
||||||
|
|||||||
Reference in New Issue
Block a user