Skip to content

Commit f3b76d1

Browse files
author
Tony Bedford
committed
Send SMS with Unicode building block.
1 parent 86f35d9 commit f3b76d1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

sms/send-an-sms-with-unicode.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import os
2+
from os.path import join, dirname
3+
from dotenv import load_dotenv
4+
5+
dotenv_path = join(dirname(__file__), '../.env')
6+
load_dotenv(dotenv_path)
7+
8+
NEXMO_API_KEY = os.getenv('NEXMO_API_KEY')
9+
NEXMO_API_SECRET = os.getenv('NEXMO_API_SECRET')
10+
TO_NUMBER = os.getenv('TO_NUMBER')
11+
12+
import nexmo
13+
14+
client = nexmo.Client(key=NEXMO_API_KEY, secret=NEXMO_API_SECRET)
15+
16+
client.send_message({
17+
'from': 'Acme Inc',
18+
'to': TO_NUMBER,
19+
'text': 'こんにちは世界',
20+
'type': 'unicode',
21+
})

0 commit comments

Comments
 (0)