wip emails

This commit is contained in:
2025-11-26 21:23:48 -03:00
parent 31d3eb6d87
commit 14cdafbec9
9 changed files with 296 additions and 41 deletions

View File

@@ -1,4 +1,3 @@
import json
from datetime import datetime
from http import HTTPStatus
from io import BytesIO
@@ -114,21 +113,19 @@ def sample(course_id: str, s3_uri: Annotated[str, Body(embed=True)]):
# Send template URI and data to Paperforge API to generate a PDF
r = requests.post(
PAPERFORGE_API,
data=json.dumps(
{
'template_uri': s3_uri,
'args': {
'name': 'Juscelino Kubitschek',
'cpf': '***.810.132-**',
'score': 100,
'started_at': now_.strftime('%d/%m/%Y'),
'completed_at': now_.strftime('%d/%m/%Y'),
'today': _datefmt(now_),
'year': now_.strftime('%Y'),
'expires_at': now_.strftime('%d/%m/%Y'),
},
json={
'template_uri': s3_uri,
'args': {
'name': 'Juscelino Kubitschek',
'cpf': '***.810.132-**',
'score': 100,
'started_at': now_.strftime('%d/%m/%Y'),
'completed_at': now_.strftime('%d/%m/%Y'),
'today': _datefmt(now_),
'year': now_.strftime('%Y'),
'expires_at': now_.strftime('%d/%m/%Y'),
},
),
},
)
r.raise_for_status()