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 765e8895
authored
2020-07-19 18:40:58 +0000
by
Juan Pablo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
me hace renegar los adjuntos
1 parent
95983bd4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
services.py
services.py
View file @
765e889
...
@@ -198,9 +198,9 @@ class Mail(ServiceBase):
...
@@ -198,9 +198,9 @@ class Mail(ServiceBase):
"content"
:
[{
"type"
:
"text/plain"
,
"value"
:
str
(
msg
[
"Body"
])}]}
"content"
:
[{
"type"
:
"text/plain"
,
"value"
:
str
(
msg
[
"Body"
])}]}
if
not
len
(
msg
[
"Adjuntos"
])
==
0
:
if
not
len
(
msg
[
"Adjuntos"
])
==
0
:
data
[
"attachments"
]
=
msg
[
"Adjuntos"
]
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
)
r
=
requests
.
post
(
url
=
"https://api.sendgrid.com/v3/mail/send"
,
data
=
json
.
dumps
(
data
),
headers
=
headers
)
print
(
r
.
text
)
#
print(r.text)
return
(
msg
[
"succ"
])
return
(
msg
[
"succ"
])
def
leerDatosparaApi
(
self
,
info
,
data
):
def
leerDatosparaApi
(
self
,
info
,
data
):
...
@@ -220,7 +220,10 @@ class Mail(ServiceBase):
...
@@ -220,7 +220,10 @@ class Mail(ServiceBase):
msg
[
"Body"
]
=
objeto
.
read
()
msg
[
"Body"
]
=
objeto
.
read
()
else
:
else
:
objeto
=
open
(
filepath
,
"rb"
)
objeto
=
open
(
filepath
,
"rb"
)
adj
=
{
"content"
:
base64
.
b64encode
(
objeto
.
read
()),
"filename"
:
file
}
adj
=
{
"content"
:
str
(
base64
.
b64encode
(
objeto
.
read
())),
"filename"
:
file
,
"disposition"
:
"attachment"
,
"type"
:
"application/pdf"
}
msg
[
"Adjuntos"
]
.
append
(
adj
)
msg
[
"Adjuntos"
]
.
append
(
adj
)
objeto
.
close
()
objeto
.
close
()
return
(
msg
)
return
(
msg
)
...
...
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