我创建了一个自定义帖子类型,它在默认编辑器上使用自定义字段。我想在更新帖子时收到电子邮件通知。电子邮件不必显示差异(尽管这会很好)。
我试过了Email Post Changes 它要求您启用“修订”。我已经尝试过启用它,我猜测,因为我没有使用默认编辑器,没有它它就无法工作。
有没有想过让插件正常工作,或者弄清楚如何在更新自定义帖子类型时发送电子邮件?
我创建了一个自定义帖子类型,它在默认编辑器上使用自定义字段。我想在更新帖子时收到电子邮件通知。电子邮件不必显示差异(尽管这会很好)。
我试过了Email Post Changes 它要求您启用“修订”。我已经尝试过启用它,我猜测,因为我没有使用默认编辑器,没有它它就无法工作。
有没有想过让插件正常工作,或者弄清楚如何在更新自定义帖子类型时发送电子邮件?
如果发布帖子,还可以自定义帖子类型、钩子get form status和post\\u type-{$new_status}_{$post->post_type}
- 处于活动状态,您可以使用此挂钩发送邮件。作为发布音乐的示例:add_action(\'publish_music\', \'fb_my_function\');
您还可以在邮件中发送修订,修订只是其他帖子类型,可以从数据库获取并添加到邮件的消息中。也许你可以在my last plugin, 发送邮件征求意见和帖子。
自定义post类型“归档”的简单示例
public $post_type_1 = \'archiv\';
add_action( \'publish_\' . $this -> post_type_1, array( $this, \'fb_my_function\') );
public function fb_my_function( $post_id = FALSE ) {
if ( $post_id ) {
// get data from current post
$post_data = get_post( $post_id );
//var_dump($post_data);exit; <-- see this for all content or use the id for get the revisons
// get mail from author
$user_mail = get_userdata( $post_data -> post_author );
// email addresses
$to = \'test@example.com\'
// email subject
$subject = get_option( \'blogname\' ) . \': \' . $post_data -> post_title;
// message content
$message = $post_data -> post_content . \' \' . PHP_EOL .
get_author_name( $post_data -> post_author ) . \' \' . PHP_EOL . .
get_permalink( $post_id );
// create header data
$headers = \'From: \' .
get_author_name( $post_data -> post_author ) .
\' (\' . get_option( \'blogname\' ) . \')\' .
\' <\' . $user_mail -> user_email . \'>\' .
PHP_EOL;
// send mail
wp_mail(
$to,
$subject,
$message,
$headers
);
}
return $post_id;
}
我想显示一个复选框,其中包含通过电子邮件订阅网站的选项我看到一个wordpress博客,上面的复选框旁边有以下标签通过电子邮件订阅此网站问题是我找不到显示它的插件:我尝试了Subscribe2、Post Notification和Gurken进行评论订阅。你知道我需要安装什么插件吗?