[WordPress] 外掛分享: Blue Cube Email Templates

首頁外掛目錄 › Blue Cube Email Templates
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
30+
安裝啟用
尚無評分
3446 天前
最後更新
問題解決
WordPress 4.4+ v1.0 上架:2016-02-01

內容簡介

這個外掛程式主要是針對開發人員而設計,比起其他類型的使用者更具有實用價值。

你是否曾經遇過一個客戶希望能夠獨立地更新你的程式以及其所發送的電子郵件內容?如果有的話,那麼這個外掛程式可能會幫助你讓客戶更滿意。

使用方法:

啟動此外掛程式後,它會在你的網站上新增一個自訂文章類型,稱為「Email Templates」。你可以使用這個自訂文章類型來創建模板,模板可以包含佔位符,讓你的程式可以使用所需的值來填充它們。佔位符的範例可能是 {USERNAME} 或 {USER_EMAIL},請注意,佔位符不應包含小寫字母。

此外掛程式會創建一個名為 $bluecube_email_template 的 BlueCube\Email_Template 類別的全域實例。一旦你創建了一個模板,你就可以使用該實例的 sendEmail() 方法來發送電子郵件。

$email_args = array(
'template_title' => '你的模板標題',
'to' => $email,
'variables' => array('username' => 'JohnDoe', 'user_email' => '[email protected]'),
);
$bluecube_email_template->sendEmail($email_args);

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

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

原文外掛簡介

This plugin is intended to be useful more for developers than other types of users.
Have you ever had a client who likes to be able to independently update the content of the emails that your code is sending out programmatically? If so, this plugin might help you make your client happy.
How to use:
When you activate the plugin, it adds a custom post type to your website called “Email Templates”. You can create your templates using this custom post type. Templates can contain placeholders for your code to fill them up with desired values. A placeholder sample would be {USERNAME} or {USER_EMAIL}. Please note, placeholders should not contain lowercase letters.
This plugin creates a global instance of the BlueCube\Email_Template class which is called $bluecube_email_template. Once you have created a template, you can use the sendEmail() method of the instance to send out your emails.
$email_args = array(
'template_title' => 'your-template-title',
'to' => $email,
'variables' => array('username' => 'JohnDoe', 'user_email' => '[email protected]'),
);
$bluecube_email_template->sendEmail($email_args);

延伸相關外掛

文章
Filter
Apply Filters
Mastodon