-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterpolacao.py
More file actions
38 lines (34 loc) · 860 Bytes
/
interpolacao.py
File metadata and controls
38 lines (34 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
""" Imprime a mensagem de um email
NÃO MANDE SPAM
"""
__version__ = "0.1.1"
import sys
import os
arguments = sys.argv[1:]
if not arguments:
print("informe o nome do arquivo de emails")
sys.exit(1)
filename = arguments[0]
templatename = arguments[1]
path = os.curdir
filepath = os.path.join(path, filename)
templatepath = os.path.join(path, templatename)
clientes = []
for line in open(filename):
name, email = line.split(",")
#TODO substituir por envio de email
print(f'Enviando email para: {email}')
print()
print(
open(templatepath).read()
% {
"nome": name,
"produto": "caneta",
"texto": "Escrever muito bem",
"link": "https://canetaslegais.com",
"quantidade": 1,
"preco": 50.5,
}
)
print("-" * 50)