• Resolved oekoplatt

    (@oekoplatt)


    Hi folks,
    thank you for this plugin. I like it. But it seems, there is an error in email subject.
    If I send “For each Post” the subject is used, as defined in the template (“new post: {TITLE}”).
    But if I want to send a digest and define the Subject Line as “{COUNT} new posts” the received email subject is “[?kologische Plattform bei DER LINKEN] Once every five minutes Digest Email”. I don’t need the information about the sending interval. So the email subject could be one for all intervals. , “Digest Email” would be ok but it’s not necessary.
    I couldn’t find out where “Once every five minutes Digest Email” comes from and didn’t find it in the pot-file. So cannot translate it.

    Please help and give me the information how to change it.

    Thank You

    • This topic was modified 5 years, 4 months ago by oekoplatt.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • @oekoplatt

    This is by design as digest post subjects cannot contain the title of multiple posts.

    If you want to change the subject there is a hook in the API to do this: s2_email_subject

    Example dose would be as follows:

    function okologische_subject() {
    	return '“[?kologische Plattform bei DER LINKEN]  Digest Email';
    }
    add_filter( 's2_email_subject', 'okologische_subject' );

    You could create a custom plugin with this code or add to a child theme functions.php file.

    Thread Starter oekoplatt

    (@oekoplatt)

    Thank you for the explanation. It works.
    However this solution doesn’t contain the counter of new posts {COUNT}. Of course I can write it in the template body, but it would be more comfortable and consequential to take the email subject from the subject line of the template.
    At present user of the plugin expect, that he define something, but he becomes a very different beast.

    Is it possible to use the content from template subject line?

    Thank you

    @oekoplatt

    The filter allows you to manipulate and change the string however you want – the code above completely over-writes the original but you could use a str_replace() function call to remove part of the text replacing it with nothing.

    function okologische_subject( $subject ) {
    	return str_replace( 'Once every five minutes ', '', $subject );
    }
    add_filter( 's2_email_subject', 'okologische_subject' );
    Thread Starter oekoplatt

    (@oekoplatt)

    Of course, I understand. But my question is:

    Is it possible to use the content from template subject line?

    Thank You

    @oekoplatt

    Some of the template keywords will work in the Subject of the email – on my checking currently {COUNT} does not.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘error in email subject line’ is closed to new replies.