• hi there,
    great and simple plugin, already started to translate into german ??

    However, there is one issue:
    The Mail subject is always the same.

    Since i want to send only 1 full post, i want the mail subject to be the ###POSTTITLE###.
    Currently, the mail subject is fixed and has no chance of getting the readers attention.

    Greetings Matt

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter mattblox

    (@mattblox)

    My quick&dirty solution:
    query/newsletter.php, line 89:
    after $post_title = $post->post_title; insert:
    if($action=="first_post_title")Return $post_title;

    sendmail/sendmail-subscriber.php line 45:
    after content, insert another alp_template_compose:

    $first_post_title = elp_cls_newsletter::elp_template_compose($data[0]['elp_set_templid'], $data[0]['elp_set_postcount'], $data[0]['elp_set_postcategory'], $data[0]['elp_set_postorderby'], $data[0]['elp_set_postorder'], "first_post_title");
    
    $subject =  substr_count($subject,"###POSTTITLEONLY###")?$first_post_title:str_replace("###POSTTITLE###", $first_post_title, $subject);

    now, in the mail configuration you can add ###POSTTITLE### or ###POSTTITLEONLY### to extend or replace the mail subject.

    I added the above code but only getting ###POSTTITLEONLY### in the subject not the
    actual title. Not getting any errors, just not replacing the variable with actual title.

    Thread Starter mattblox

    (@mattblox)

    Hi there, does it work for ###POSTTITLE###?

    Nope, I just changed :
    $subject = substr_count($subject,”###POSTTITLEONLY###”)?$first_post_title:str_replace(“###POSTTITLE###”, $first_post_title, $subject);
    To:
    $subject = $first_post_title;
    And I’m still getting the variable not the title.

    Thread Starter mattblox

    (@mattblox)

    did i miss something?

    email-posts-to-subscribers/sendmail/sendmail-subscriber.php
    https://pastebin.com/7uWSayMZ

    email-posts-to-subscribers/query/newsletter.php
    https://pastebin.com/qZZ72hTY

    • This reply was modified 5 years, 7 months ago by mattblox.
    • This reply was modified 5 years, 7 months ago by mattblox.

    I’m using 4.4 so I’ll grab 4.8 & try it.

    Actually installed 4.9 with the edits. Working great thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘mail subject ###POSTTITLE###’ is closed to new replies.