Skip to content

Commit

Permalink
add dest 'links' and 'article' to email module
Browse files Browse the repository at this point in the history
  • Loading branch information
cdhigh committed Nov 3, 2024
1 parent 4d8b899 commit c8ea173
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions application/view/inbound_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ def ReceiveMailImpl(sender: str, to: Union[list,str], subject: str, txtBodies: l
if ret:
return 'Sent:<br/>{}'.format('<br/>'.join(ret))

forceLinks = False #强制提取链接
forceArticle = False #强制发送邮件内容
forceLinks = bool(dest == 'links') #强制提取链接
forceArticle = bool(dest == 'article') #强制发送邮件内容

#邮件主题中如果存在 !links ,则强制提取邮件中的链接然后生成电子书
if subject.endswith('!links') or ' !links ' in subject:
Expand Down
4 changes: 2 additions & 2 deletions docs/Chinese/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ KindleEar不保存密码原文,无法取回密码。在登录时密码验证

2. 此邮箱将收到的邮件正文转换为邮件附件推送至你注册的Email邮箱。如果邮件中只有链接(多个链接则每行一个),则抓取链接的网页内容制作成电子书然后再推送。

3. 如果在邮件主题最后添加了标识 !links,则不论邮件内容如何,KindleEar都只会提取邮件中的链接,然后抓取网页,制作成电子书发送至你的Kindle。这个功能最适合将网络连载网页直接发送至Kindle观看。
3. 如果邮件发送至 `links@domain` 或在邮件主题最后添加了标识 !links,则不论邮件内容如何,KindleEar都只会提取邮件中的链接,然后抓取网页,制作成电子书发送至你的Kindle。这个功能最适合将网络连载网页直接发送至Kindle观看。

4. 如果在邮件主题后添加了标识 !article,则忽略所有链接,直接将内容转换为电子书发送。
4. 如果邮件发送至 `article@domain` 或在邮件主题后添加了标识 !article,则忽略所有链接,直接将内容转换为电子书发送。

5. 推送的电子书默认语言为自定义RSS的语言,如需要其他语种,可以在邮件主题后添加标识 !lang=en (将en替换为您需要的语种代码)。

Expand Down
4 changes: 2 additions & 2 deletions docs/English/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ If deployed using Docker Compose, the email address is: `xxx@domain`, remember t

2. This email will convert the received email body into e-book and push them to your registered email. If the email only contains links (one link per line), it will fetch the web content of the links and create an e-book before pushing.

3. If email subject contains the identifier `!links`, regardless of the email content, KindleEar will only extract the links from the email, then fetch the webpages and send them as e-books to your Kindle. This feature is best suited for sending serialized web content directly to Kindle for viewing.
3. If email's address is `links@domain` or subject contains the identifier `!links`, regardless of the email content, KindleEar will only extract the links from the email, then fetch the webpages and send them as e-books to your Kindle. This feature is best suited for sending serialized web content directly to Kindle for viewing.

4. If the identifier `!article` is present in the subject, all links will be ignored, and the content will be directly converted into an e-book for delivery.
4. If email's address is `article@domain` or the identifier `!article` is present in the subject, all links will be ignored, and the content will be directly converted into an e-book for delivery.

5. The default language of the e-book is same as of the custom RSS. If you need another language, you can add the identifier `!lang=en` (replace `en` with the language code you need) after the email subject.

Expand Down

0 comments on commit c8ea173

Please sign in to comment.