Not working yet
This commit is contained in:
+9
-2
@@ -69,7 +69,7 @@ impl Service {
|
||||
};
|
||||
|
||||
let events = events.unwrap_or_default();
|
||||
for event in events {
|
||||
for event in &events {
|
||||
println!("Event: {event:?}");
|
||||
let contact = &match contacts.get(&event.contact_id).await {
|
||||
Ok(contact) => contact,
|
||||
@@ -95,6 +95,7 @@ impl Service {
|
||||
|
||||
println!("Contact Id: {:?}", contact.id);
|
||||
println!("Message Id: {:?}", message.id);
|
||||
println!("Scheduled Message Id: {:?}", scheduled_message.id);
|
||||
|
||||
let param = swoosh::twilio::types::Parameters {
|
||||
schedule: true,
|
||||
@@ -102,10 +103,13 @@ impl Service {
|
||||
};
|
||||
|
||||
let twilio_config = &self.app.twilio_config;
|
||||
println!("Config: {twilio_config:?}");
|
||||
println!("SM: {scheduled_message:?}");
|
||||
|
||||
match swoosh::twilio::api::send_message(&message, contact, ¶m, twilio_config).await
|
||||
match swoosh::twilio::api::send_message(&message, &contact, ¶m, twilio_config).await
|
||||
{
|
||||
Ok(resp) => {
|
||||
println!("Message scheduled");
|
||||
// MER response
|
||||
let result = swoosh::twilio::api::response_to_json(resp).await;
|
||||
let mer = textsender_models::message::event::MessageEventResponse {
|
||||
@@ -120,14 +124,17 @@ impl Service {
|
||||
|
||||
match mer_req.record_message_event_response(&mer).await {
|
||||
Ok(response) => {
|
||||
println!("Recording MER");
|
||||
println!("Response: {response:?}");
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Error recording mer");
|
||||
eprintln!("Error: {err:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Message not sent");
|
||||
eprintln!("Error: {err:?}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user