mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-13 19:37:42 +01:00
fine tunings ;)
This commit is contained in:
parent
e9f625f008
commit
0c1eb13d93
3 changed files with 19 additions and 40 deletions
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 />
|
||||
|
|
Loading…
Add table
Reference in a new issue