[WordPress] 外掛分享: WP-EMail

首頁外掛目錄 › WP-EMail
WordPress 外掛 WP-EMail 的封面圖片
1,000+
安裝啟用
★★★★
4.5/5 分(11 則評價)
38 天前
最後更新
問題解決
WordPress 6.8+ PHP 8.2+ v3.0.0 上架:2006-01-02

內容簡介

WP-EMail 外掛可在您的文章和頁面上添加「Email This Post」連結,讓訪客輕鬆分享內容。使用者只需填寫姓名、朋友的姓名和電子郵件地址,然後透過 wp_mail() 發送文章,並且所有發送的郵件都會被記錄,方便管理和追蹤。

【主要功能】
• 自訂「Email This Post」連結的 HTML 模板
• 支援獨立郵件頁面或彈出視窗
• 可選擇 HTML 或純文字訊息格式
• 圖片驗證防止垃圾郵件
• 排序和分頁的郵件記錄
• 小工具顯示最常被分享的文章

外掛標籤

開發者團隊

⬇ 下載最新版 (v3.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP-EMail」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

WP-EMail puts an “Email This Post” link on your posts and pages. A visitor clicking it gets a small form, fills in their name, their friend’s name and address and an optional remark, and the article goes out through wp_mail() — so it uses whatever WordPress itself is set up to send with.
Every message is logged, so you can see what was sent, to whom, from which address and whether it arrived. The page title, the subject line, the HTML body, the plain text body and every message the visitor sees are templates you can edit, each with its own list of variables and a button to put the original back.
Features

An “Email This Post” link built from an HTML template you edit, with the envelope glyph, the wording and the post type as variables
A standalone e-mail page or a popup window
HTML or plain text messages, with the article whole or cut to a word count
Image verification, and a minimum interval between sends, to keep the form off spammers’ lists
A sortable, paginated log of every message, with totals and a one-click purge
A widget and template tags for the most emailed posts and pages
A block on the WP-Stats page, if you have WP-Stats installed

Donations
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
Usage
The plugin works as soon as it is activated. All you have to decide is where the e-mail link appears.
On selected posts and pages, type the shortcode into the content:
[email_link]

This works in both block and classic themes, and puts the link exactly where you want it rather than on everything.
On every post and page, call the template tag from your theme instead. In a classic theme, open wp-content/themes//index.php — or single.php, page.php, and so on — find:

and add this inside the loop, where you want the link to show:

Use one or the other, not both, or the link appears twice.
If the link is there but clicking it gives a 404, re-save your permalinks under WP-Admin -> Settings -> Permalinks. The plugin registers its /email/ endpoint on activation, but a site with unusual rewrite rules can need the nudge.
Everything else is configured under WP-Admin -> E-Mail -> Settings, which has two tabs: Settings for the link, the form and delivery, and Templates for the eight message templates. The log of what has been sent is under WP-Admin -> E-Mail -> Manage E-Mail.
Filters
Use wp_email_capability to hand a screen to a capability other than the default. The logs screen is gated on manage_email and the settings screen on manage_options:
add_filter( 'wp_email_capability', function ( $capability, $context ) {
return 'logs' === $context ? 'edit_posts' : $capability;
}, 10, 2 );

Use wp_email_form_field_values to pre-fill the form. The plugin uses it itself to fill in a logged-in visitor’s name and address:
add_filter( 'wp_email_form_field_values', function ( $values ) {
$values['yourremarks'] = 'Thought you would like this.';

return $values;
} );

The other three are wp_email_ipaddress (the address a send is attributed to), wp_email_template_redirect (whether the plugin takes over the request for its own endpoints) and wp_email_trust_proxy (whether the usual forwarding headers may be trusted).

延伸相關外掛

文章
Filter
Mastodon