fine tunings ;)

This commit is contained in:
dni ⚡ 2023-01-09 10:13:54 +01:00
parent e9f625f008
commit 0c1eb13d93
3 changed files with 19 additions and 40 deletions

View file

@ -9,18 +9,6 @@ This extension allows you to setup a smtp, to offer sending emails with it for a
## Usage
1. Create new emailaddress
2. Verify if email goes to your testemail. Testmail is send on create and update
3. enjoy
2. Verify if email goes to your testemail. Testmail is sent on create and update
3. Share the link with the email form.
## API Endpoints
- **Emailaddresses**
- GET /api/v1/emailaddress
- POST /api/v1/emailaddress
- PUT /api/v1/emailaddress/<domain_id>
- DELETE /api/v1/emailaddress/<domain_id>
- **Emails**
- GET /api/v1/email
- POST /api/v1/email/<emailaddress_id>
- GET /api/v1/email/<payment_hash>
- DELETE /api/v1/email/<email_id>

View file

@ -36,32 +36,23 @@ async def send_mail(emailaddress, email):
msg["To"] = email.receiver
signature = "Email sent anonymiously by LNbits Sendmail extension."
text = (
"""\
"""
+ email.message
+ """
"""
+ signature
+ """
"""
)
text = f"""
{email.message}
html = (
"""\
<html>
{signature}
"""
html = f"""
<html>
<head></head>
<body>
<p>"""
+ email.message
+ """<p>
<p><br>"""
+ signature
+ """</p>
<p>{email.message}<p>
<br>
<p>{signature}</p>
</body>
</html>
"""
)
</html>
"""
part1 = MIMEText(text, "plain")
part2 = MIMEText(html, "html")
msg.attach(part1)

View file

@ -12,7 +12,7 @@
<p>
Charge people for using sending an email via your smtp server<br />
<a
href="https://github.com/lnbits/lnbits-legends/tree/main/lnbits/extensions/smtp"
href="https://github.com/lnbits/lnbits/tree/main/lnbits/extensions/smtp"
>More details</a
>
<br />