Tag Info

New answers tagged

0

That's because wp_mail expects the attachment to be a filename (filepath) that it can attach and send. You are supplying a string containing the contents of the file: function create_csv() { $filepath = '/path/to/the/file.csv'; $fd = fopen($filepath, 'w'); if($fd === FALSE) { die('Failed to open temporary file'); } $records = ...


2

As this is an AJAX function your function must exit; or die(); after the final line of executed code, in this case outside of the if statement before the final } However I don't think this is the true issue, if you are getting a 0 returned in my experience it means the function is not running because admin-ajax.php returns 0 if it hits the end of the file ...


0

I had a related issue and coded a plugin a few weeks ago. WP-HTML Mail doesn't support gravity forms now, but if you decide to change you form to Ninja Forms, the plugin is perfect for you. I added detectors for plugins to find out which plugin just sent the mail. Changing formatting and sender can be turned on/off for detected plugins.


0

I think I found the answer on another forum discussing using Contact Form7, with the same issue I was having. This is what I got from that thread and tried. It does appear to work and does appear to be only targeting email from the default 'Wordpress' sender name/email. // Change default WP email sender add_filter('wp_mail_from', 'doEmailFilter'); ...


0

You're almost there but you were not actually picking up any of email addresses from your User Query This code should do what you want, however if my understanding of your question is correct you want to send an individual email to each Subscriber, which is not efficient. It would be better to add all email addresses to an array and send the emails in one ...


1

You were on the right track when you built your WP_User_Query, but you are not using the result of this query. See this: //verify post is not a revision if ( !wp_is_post_revision( $post_id ) ) { //gets subscirbers to send email to // WP_User_Query arguments $args = array ( 'role' => 'Subscriber', ...


0

WordPress uses the wp_mail() function to send mail. It says on the Codex article there that: For this function to work, the settings SMTP and smtp_port (default: 25) need to be set in your php.ini file. Also be sure to check that your contact form is sending the required parameters to the wp_mail() function. The required parameters are included on the ...


2

There's a few things you need to do here, you need to modify your add_action to accept args and also you need to specify whether to use the data before the update or the data after the update Try something like this: function send_media_emails($post_id, $post_after){ if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return; ...



Top 50 recent answers are included