wordpress发邮件_在WordPress中发表文章时如何向作者发送电子邮件

wordpress发邮件

If you run a multi-author blog, then notifying the authors when their blog post is published can help them promote the post and participate in the discussion. Recently, one of our readers asked if it was possible to email authors when their articles are published. In this article, we will show you how to email authors when their posts are published in WordPress.

如果您运行多作者博客,则在发布他们的博客帖子时通知作者可以帮助他们推广该帖子并参与讨论。 最近,一位读者问,发表文章时是否可以通过电子邮件发送给作者。 在本文中,我们将向您展示在WordPress中发布作者帖子时如何通过电子邮件发送给作者。

Notify authors of new posts
方法1:使用编辑流程将帖子通知发送给作者 (Method 1: Send Post Notifications to Authors using Edit Flow)

First thing you need to do is install and activate the Edit Flow plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活Edit Flow插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Edit Flow works out of the box for email notifications. As soon as you activate the plugin, it will start sending email notifications to authors when their posts are published.

编辑流程开箱即用,可用于电子邮件通知。 激活插件后,发布者发布帖子后,它将开始向作者发送电子邮件通知。

However, it does not send those email notifications to site administrator. You can go to Edit Flow » Notifications page and select enable for ‘Always notify blog admin’ option.

但是,它不会将那些电子邮件通知发送给站点管理员。 您可以转到“ 编辑流»通知”页面,然后为“始终通知博客管理员”选项选择启用。

Edit Flow notifications

Edit Flow is a powerful plugin, and it can do a lot more than just sending email notifications. For a full overview of what you can do with it, see our guide on how to improve your editorial workflow in WordPress with Edit Flow.

Edit Flow是一个功能强大的插件,它不仅可以发送电子邮件通知,还可以做很多事情。 有关使用该功能的完整概述,请参阅我们的指南, 指南介绍了如何使用Edit Flow改进WordPress中的编辑工作流程

方法2:使用更好的WordPress通知的电子邮件作者 (Method 2: Email Authors using Better Notifications for WordPress)

This method is for users who just want to send email notifications to authors without any other editorial features of Edit Flow.

此方法适用于只希望向作者发送电子邮件通知而没有“编辑流”的任何其他编辑功能的用户。

First thing you need to do is install and activate the Better Notifications for WordPress plugin.

您需要做的第一件事是安装并激活WordPress更好的通知插件。

Upon activation, you need to visit Notifcations » Add New page to create your author email notification.

激活后,您需要访问通知»添加新页面以创建您的作者电子邮件通知。

Create a new post published notification for authors in WordPress

First you need to a enter a title for this notification, for e.g. ‘Post Published Notification for Authors’.

首先,您需要为此通知输入标题,例如“作者的发布后通知”

In the ‘Notification for’ field, you need to select ‘New post published’.

“通知”字段中,您需要选择“发布新帖子”

Under Additional Email Fields option, check the box next to ‘Send this notification to the Author only’.

在“ 其他电子邮件字段”选项下,选中“ 仅将此通知发送给作者”旁边的框。

Now you need to write a subject line and email body. Better WordPress Notifications comes with a handful of shortcodes that you can use in your email subject and body.

现在,您需要编写主题行和电子邮件正文。 更好的WordPress通知附带了一些短代码,您可以在电子邮件主题和正文中使用它们。

In the email subject field you should enter:

在电子邮件主题字段中,您应该输入:

Post Published: [post_title]

Post Published: [post_title]

For message body, you can use this template:

对于邮件正文,可以使用以下模板:

Hello [user_nicename],

您好[user_nicename],

We just published your post “[post_title]”.

我们刚刚发布了您的帖子“ [post_title]”。

You can view it here: [permalink]

您可以在这里查看:[永久链接]

Thanks,

谢谢,

Finally, you need to click on the save button to store your new notification.

最后,您需要单击保存按钮来存储新通知。

The plugin will now send a notification email to authors when their posts are published in WordPress.

现在,当他们的帖子在WordPress中发布时,该插件将向作者发送通知电子邮件。

For more detailed instructions, see our guide on how to add better custom notifications in WordPress.

有关更多详细说明,请参见有关如何在WordPress中添加更好的自定义通知的指南。

方法3:在文章发表后手动向作者发送电子邮件 (Method 3: Manually Send Email to Authors When Their Articles are Published)

This method is for users who are comfortable adding code snippets in WordPress.

该方法适用于愿意在WordPress中添加代码段的用户。

You need to add this code to your theme’s functions.php file or a site-specific plugin.

您需要将此代码添加到主题的functions.php文件或特定站点的插件中


function notifyauthor($post_id) {

$post = get_post($post_id);
$author = get_userdata($post->post_author);
$subject = "Post Published: ".$post->post_title."";

$message = "
      Hi ".$author->display_name.",
      
      Your post, \"".$post->post_title."\" has just been published.
      
      View post: ".get_permalink( $post_id )."
      
      Thanks"
      ;
      
   wp_mail($author->user_email, $subject, $message);
}
add_action('publish_post', 'notifyauthor');

This code runs when a new post is published in WordPress. It sends an email notification to the author using the subject and message defined in the code. Feel free to change the subject and message fields to meet your needs.

在WordPress中发布新帖子时,将运行此代码。 它使用代码中定义的主题和消息向作者发送电子邮件通知。 可以随意更改主题和消息字段,以满足您的需求。

Troubleshooting Tip:

故障排除提示:

If your authors complain about not receiving email notifications, then check out our guide on how to fix WordPress not sending email issue.

如果您的作者抱怨没有收到电子邮件通知,请查看有关如何修复WordPress不发送电子邮件问题的指南

We hope this article helped you email authors when their articles are published in WordPress. You may also want to see our expert pick of 21 plugins to efficiently manage WordPress multi-author blogs.

我们希望本文能帮助您在WordPress中发表文章时给作者发送电子邮件。 您可能还希望看到我们精选的21个插件来有效地管理WordPress多作者博客

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-email-authors-when-their-articles-are-published-in-wordpress/

wordpress发邮件

自动邮件发送博客文章WordPress插件完成一项很简单的功能,每当一篇博客文章发布后,WordPress会自动发送一封Email邮件到几个指定的电子信箱之。这个 插件是修改自一个名为Post2Mail的邮件插件,可惜原插件作者已经删除此插件的下载和更,而且原插件不支持文,文内容的文章将被发送为乱码, 同原插件还有一个小小的安全漏洞,别人可以查看配置源代码。因此我就在这个插件的基础上进行了一番修改,修改相关的问题并使其完全支持文系统。   增加的功能   1、使用base64对文邮件标题进行编码,完美支持文邮件标题,在任何客户端显示都没有邮件标题乱码。   2、邮件的内容也完美支持文。   3、修改了原来插件的安全漏洞。   如何使用这个插件   修改post2mail.config.php文件,增加邮件地址到配置文件,我们知道MSN Live Spaces和Blogspot都有邮件发布博客功能,我们可以将Live Spaces和Blogspot的邮件发送地址填入,这样,每当我们在WordPress发布一篇文章,这篇文章都会自动更到MSN Spaces和BlogSpot.这样就可以同三个博客了。   的修改汉化版的POST2MAIL我目前在Google的Blogger和微软的MSN Spaces的邮件发送上测试成功,发送邮件的内容均没有乱码。   本程序在Apache和PHP5环境下测试通过,不需要配置邮件服务器就可以发送邮件。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值