Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter thefraj

    (@thefraj)

    Okay I’ve got it working! ??

    Not sure what you’ve done here, but to resolve it I just had to hard code the subject line. You may wish to check this for future releases.

    But to resolve it, I went to:

    /wp-content/plugins/contact-form-7/includes

    Open up mail.php

    And hard-code the subject line (on line 117) where you call wp_mail(…): and it works fine!

    return wp_mail( $recipient, “Subject line here”, $body, $headers, $attachments );

    So there’s something not right about how you are retrieving the subject for the email – or, it’s possible if no subject line was entered (or something similar) the method call may fail

    You may wish to look at that for future releases,

    Thread Starter thefraj

    (@thefraj)

    Sorry to keep posting, but I’ve found the snippet of code within CF7 calling wp_mail(…)

    So I then abstracted this into a separate php script and ran it – and it also works fine (I get emails sent with wp_mail(…) too

    What is CF7 doing in addition to this which may be breaking?

    Thread Starter thefraj

    (@thefraj)

    Actually, ignore that because I have little faith it can be made to work – could someone let me know where (in code) is the point at which emails should be sent.

    I will write my own code to send them, that way I know it will work – I just need to know which part of the code this should be done in, please

    Many thanks,

    Thread Starter thefraj

    (@thefraj)

    Hi All,

    I think I have a bit more about this: firstly, using the short tag outputs only the markup – not the assets (hence why it doesn’t work for me here), and testing further, I think it’s because we are using entirely custom templates and theme.

    I tried installing a vanilla version of WordPress and used the standard themes that can with it and noticed a series of JS includes and initialisation functions getting injected into the footer.

    Obviously this plugin will not work with custom templates without knowing how to output these assets.

    Does anyone have an ideas how to do this?

    Many thanks,

    Rog

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

    Okay, sorry eazy187 I solved it on mine, but this may not help you because it was something I had done to the index.php file in the wp-content/themes/<mytheme> folder.

    Make sure that this file is correct and if you have a static homepage, WP uses home.php, which oddly it also seems to use for the search results.

    I had to add:

    <?php if (!is_search() ) { ?>
    … REST OF HOMEPAGE CONTENT …
    <?php }; ?>

    which fixed this.

    Try changing themes and see if this fixes it, to help you know if it is the theme or something with the WP code itself.

    Hi,

    I’m having the same problem. I’m fairly certain it has something to do with the template, because the search works fine using other templates.

    Whether this is because something has changed in 2.8 about the search, which has caused some templates to break, or whether it is because I’ve done something to the template itself I’m not sure just yet.

    If I get to the bottom of it, I’ll let you know.

Viewing 6 replies - 1 through 6 (of 6 total)