Help to change the text for new website notification (wpmu_welcome_notification)

Here’s an untested example, how you could modify the email body to your needs: add_filter( ‘update_welcome_email’, function( $welcome_email, $blog_id, $user_id, $password, $title, $meta ) { // Override the email body: $welcome_email = __( ‘Dear User, Your new SITE_NAME site has been successfully set up at: BLOG_URL You can log in to the administrator account with … Read more

Send transactional email: first user’s post

You’re close – let’s take a look at this line: if( ‘post’ == $post->post_type && count_user_posts(the_author_meta(‘ID’) == 1); ) That semicolon is a syntax error, PHP will barf – let it go the_author_meta() prints data, it does not return anything – use get_the_author_meta() for comparisons and passing things around The post count comparison needs to … Read more

PHP mail() works but wp_mail() does not

The plugin, WP Mail SMTP, looks like a possible solution to use the wp_mail() properly on your localhost. According to the description: Reconfigures the wp_mail() function to use SMTP instead of mail() and creates an options page to manage the settings.

Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]

I’ve found what’s been missing in the code. You have to add this also: add_filter( ‘wpcf7_mail_components’, ‘mycustom_wpcf7_mail_components’ ); function mycustom_wpcf7_mail_components( $components ) { $components[‘attachments’][] = get_template_directory().’/pdf/test.pdf’; return $components; } Now everything is working fine and the file is attached to email without the need to add fields in the contact form.

Contact form sender email

Sending an email from an address you don’t own will mean you run into problems with countermeasures again email spoofing (e.g SPF), as you’re effectively impersonating the user’s email address to send your email. You could put the user email address as the name, but send the email from an address you own For contact … Read more

Reject Comments Based on Author Email

Here’s a suggestion for a filter: /** * Filters a comment’s approval status before it is set. * * @since 2.1.0 * @since 4.9.0 Returning a WP_Error value from the filter will shortcircuit comment insertion and * allow skipping further processing. * * @param bool|string|WP_Error $approved The approval status. Accepts 1, 0, ‘spam’ or WP_Error. … Read more

How to change WordPress email notification sender?

As of version 4.9 there is a dubious “feature” that prevents you from changing the site email without a confirmation email going out, and the admin confirming his own change. Those filters, as you’ve discovered, won’t work. For instance, from now on, if you’re using WordPress for an IOT device or on localhost, it’s impossible … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)