Hi Efrain ,
To improve email sending speed using Azure Communication Services in Python, consider using the wait_until_started
parameter. Here's an example:
from azure.communication.sms import SmsClient
# Initialize your SmsClient
client = SmsClient.from_connection_string("your_connection_string")
# Create the message and send it, using wait_until_started
poller = client.begin_send(
from_phone_number="sender_phone_number",
to_phone_numbers=["recipient_phone_number"],
message="Your message content",
wait_until_started=True
)
# Get the result without waiting for completion
result = poller.result()
Setting wait_until_started
to True
allows your code to continue execution without waiting for the entire sending process, potentially reducing latency.
Regards,
Saravanan Ganesan.