Support » Plugin: Subscribe2 » [Plugin: Subscribe2] Custom Field in notification email?

  • Resolved spaciousmind


    Hi, I saw another thread about this but it seemed unclear.

    First let me say thanks for this plugin, it is really great and except for this issue below it does everything we were looking for.

    I am running a blog that uses the Custom Authors plugin since each post has a different guest author (most of whom are not WP savvy, so rather than create a user for each and have them struggle to figure out how to post and potentially screw things up, my job is to take their text and images and create and publish the posts myself). I create all the posts as Admin, and a custom field then inserts the Custom Author’s name into the post.

    When I use {AUTHORNAME} in the email that goes out, it shows up as my Admin name and not the Custom Author.

    Any help on how to get this custom field in there instead would be appreciated.

Viewing 12 replies - 1 through 12 (of 12 total)
  • @spaciousmind,

    This may be possible but I’ll need to look at how this other plugin works and see if I can make Subscribe2 compatible.


    Try this and let me know if it works. If you are sending per-post notifications look in the wp-content/plugins/subscribe2/classes/ folder and edit the class-s2-core.php file.

    In the publish() function around line 530 you’ll see this:
    $this->authorname = $author->display_name;
    Try changing that to this:
    $this->authorname = apply_filter('the_author', $author->display_name);

    If you are using digest based email instead look at the subscribe2_cron() function around line 1517, you’ll see:

    $message_post .= " (" . __('Author', 'subscribe2') . ": " . $author->display_name . ")";
    $message_posttime .= " (" . __('Author', 'subscribe2') . ": " . $author->display_name . ")";

    Try changing that to:

    $message_post .= " (" . __('Author', 'subscribe2') . ": " . apply_filter('the_author', $author->display_name) . ")";
    $message_posttime .= " (" . __('Author', 'subscribe2') . ": " . apply_filter('the_author', $author->display_name) . ")";


    Whoops, just noticed that the apply_filter should be apply_filters – note the missing trailing ‘S’ – otherwise the code is correct.

    Hey MattyRob

    Thanks for the help… this doesn’t seem to work unfortunately, still displays my admin name and not the Custom Author name.


    How did you test? For a brand new post or a preview? Also are you on per-post or digest settings in Subscribe2?

    I’ve done some more digging and have things working to a degree in my test setup, I want to make sure I’ve covered your scenario though.


    I have tested both a preview and a new post. After replacing the code you mention above and trying a new post, it now shows a blank rather than my Admin name, which it was doing on previews of posts made before the code change. This blank also happens with subsequent previews.

    We’re not using digest, just per-post.


    I’ve literally just checked in some changes to the core code that should fix the blank author name. I found a few issues in some testing I did over the weekend.

    Give the code here a try:

    Still not working for me… I have a more knowledgeable programmer friend looking into it and will report back once he’s had a chance to get in there and check it out.


    I appreciate the feedback and look forward to hearing from you if you get anywhere.

    How do I contact you? Not finding any way to do so on your site.


    Either using this forum 🙂 or here.


    I’ve not received any direct contact yet, have you tried?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: Subscribe2] Custom Field in notification email?’ is closed to new replies.