內容簡介
使用 Amazon Web Services(AWS)簡單郵件服務(SES)發送電子郵件。
基於 Sylvain Deaure 的原始 WP SES 專案。 主要差異:
不在資料庫中存儲憑證
慣例高於配置
刪除可以透過 AWS 控制台完成的任何功能
開源並透過 GitHub 進行版本控制
使用方法
查看統計信息
前往:管理員 » 儀表板 » SES 統計信息
發送測試郵件
前往:管理員 » 設置 » WP Mail SES
鉤子/篩選器
wp_mail_ses_sent_email - 在發送電子郵件後調用此函數
到 SES,並提供兩個參數:
$message_id(string 或 null)-
如果請求成功,則為 SES 提供的 MessageId,否則為 Null。
$mail_data(array)-
包含用於發送電子郵件的信息的哈希映射。密鑰包括:
to、subject、message、headers、attachments
範例:
add_filter( 'wp_mail_ses_sent_email', function ( $message_id, $mail_data ) {
if ( is_null( $message_id ) ) {
echo "發送失敗";
} else {
echo "發送成功";
}
print_r( $mail_data );
} );
外掛標籤
開發者團隊
原文外掛簡介
Uses Amazon Web Services (AWS) Simple Email Service (SES) to send emails.
Based on the original WP SES project by Sylvain Deaure. Main differences:
Does not store credentials in the database
Convention over configuration
Removed any functionality which can be done via AWS Console
Open Source and version controlled via GitHub
Usage
View statistics
Go to: Admin » Dashboard » SES Statistics
Send test message
Go to: Admin » Settings » WP Mail SES
Hooks/Filters
wp_mail_ses_sent_email - This function is called once an email has been sent
to SES and provides two parameters:
$message_id (string or null) –
The MessageId as provided by SES if the request was successful,
otherwise null.
$mail_data (array) –
A hash map containing the information used to send the email. Keys include:
to, subject, message, headers, attachments
Example:
add_filter( 'wp_mail_ses_sent_email', function ( $message_id, $mail_data ) {
if ( is_null( $message_id ) ) {
echo "Sending failed";
} else {
echo "Sending successful";
}
print_r( $mail_data );
} );
