Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
message-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit ac1ccff1
authored
2020-07-19 18:56:11 +0000
by
Juan Pablo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
anda aparentemente
1 parent
3d5a9743
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
services.py
services.py
View file @
ac1ccff
...
...
@@ -198,7 +198,7 @@ class Mail(ServiceBase):
"content"
:
[{
"type"
:
"text/plain"
,
"value"
:
str
(
msg
[
"Body"
])}]}
if
not
len
(
msg
[
"Adjuntos"
])
==
0
:
data
[
"attachments"
]
=
msg
[
"Adjuntos"
]
import
ipdb
;
ipdb
.
set_trace
()
#
import ipdb; ipdb.set_trace()
r
=
requests
.
post
(
url
=
"https://api.sendgrid.com/v3/mail/send"
,
data
=
json
.
dumps
(
data
),
headers
=
headers
)
#print(r.text)
return
(
msg
[
"succ"
])
...
...
@@ -220,10 +220,10 @@ class Mail(ServiceBase):
msg
[
"Body"
]
=
objeto
.
read
()
objeto
.
close
()
else
:
with
open
(
'attachment.pdf'
,
'rb'
)
as
f
:
with
open
(
filepath
,
'rb'
)
as
f
:
contenido
=
f
.
read
()
f
.
close
()
adj
=
{
"content"
:
base64
.
b64encode
(
data
)
.
decode
(),
adj
=
{
"content"
:
base64
.
b64encode
(
contenido
)
.
decode
(),
"filename"
:
file
,
"disposition"
:
"attachment"
,
"type"
:
"application/pdf"
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment