[WordPress] 外掛分享: SES for WordPress

首頁外掛目錄 › SES for WordPress
全新外掛
安裝啟用
尚無評分
4836 天前
最後更新
問題解決
WordPress 3.5+ v0.1 上架:2013-01-08

內容簡介

SES for WordPress

介紹

這個外掛為您的 WP 網站提供 AWS 的 Simple Email Service 支援。它支援任意的自定標題,並為您處理圖片嵌入。它會發送包含自動產生的純文字副本的 HTML 訊息。

預設情況下,它會覆蓋原生的 wp_mail 函式,所以您只需要在「設定 > SES4WP 選項」中設定 AWS 金鑰和寄件人即可。

元件

PEAR Mime_mail 用於建立訊息
Jevon Wright 的 html2text 作為純文字部分
AWS SDK v1.5

嵌入圖片

在呼叫 wp_mail() 之前,呼叫 ses4wp_embed_image 並傳入圖片 handle 和圖片路徑。它會回傳一個 content_id,您可以在 src 屬性中使用。

路徑應相對於您的 Web 伺服器根目錄,例如,要嵌入 wp-content/themes/twentyeleven/images/wordpress.png,您應該省略開頭的斜線。

例如

$content_id = ses4wp_embed_image( 'my_image', 'wp-content/path/to/image.jpg' );
$mail_body = "This is an image. <img src='cid:$content_id' />";
wp_mail( '[email protected]', 'My Subject', $mail_body );

圖片將作為附件新增至電子郵件並內嵌在訊息中。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「SES for WordPress」→ 直接安裝(推薦)

原文外掛簡介

SES for WordPress

Introduction
This plugin provides support for AWS’s Simple Email Service for your WP site. It supports arbitrary custom headers and handles image embedding for you. It sends HTML messages with an automatically-generated plain-text counterpart.
By default, it overrides the native wp_mail function, so all you need to do is configure your AWS Keys and sender in Settings > SES4WP Options.
Components

PEAR Mime_mail to create the message
Jevon Wright’s html2text for the plain-text part
AWS SDK v1.5

Embedding images
Before your call to wp_mail(), call ses4wp_embed_image with an image handle and the path to your image. It will return a content_id for you to use in your src attribute.
Paths should be given relative to your webserver root. So for instance, to embed wp-content/themes/twentyeleven/images/wordpress.png, you would omit the slash at the beginning.
eg
$content_id = ses4wp_embed_image( 'my_image', 'wp-content/path/to/image.jpg' );
$mail_body = "This is an image. ";
wp_mail( '[email protected]', 'My Subject', $mail_body );

The image will be attached to the email and delivered inline.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon