Created
September 27, 2021 10:28
-
-
Save mfrashad/ddc1dcb0cb4316e794fb17c1414708f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| def email_results_mailgun(email, prompt): | |
| return requests.post("https://api.mailgun.net/v3/text2art.com/messages", | |
| auth=("api", "YOUR_MAILGUN_API_KEY"), | |
| files=[("attachment",("output.png", open("output.png", "rb").read() )), | |
| ("attachment", ("output.mp4", open("output.mp4", "rb").read() ))], | |
| data={"from": "Text2Art <YOUR_EMAIL>", | |
| "to": email, | |
| "subject": "Your Artwork is ready!", | |
| "text": f'Your generated arts using the prompt "{prompt}".', | |
| "html": f'Your generated arts using the prompt <strong>"{prompt}"</strong>.'}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment