Questions tagged [wp-mail]

wp_mail() is a wrapper for PHPMailer which is a wrapper for PHP’s mail() function.

Filter by
Sorted by
Tagged with
0
votes
1answer
435 views

If/elseif statement within wp_mail function

I need to know what is wrong with my if statement here: //EMAIL ADMIN BASED ON PROBLEM_TYPE function new_post_creation_email() { global $post; $postid = $post->ID; $problem_type = ...
0
votes
1answer
73 views

Sending mails with wp_mail() to multiple recipients using wp_cron and dynamic email body data

I have a frontend submission form, where users can add events to a custom post type. I want to send an email to each user 1 week before this event takes place. The emails are sent via wp_cron. The ...
0
votes
1answer
111 views

Prevent sending emails on user creation in OOP context?

I need to block any user creation email on the site, and I tried overriding any pluggable function that is responsible for mail sending. The only thing that works is $this->loader->add_filter( '...
0
votes
1answer
122 views

Trigger WordPress Actions from Email?

I have built a sort of marketplace platform based on WordPress and I would like to build a few email-related functionalities to keep the platform easier to use and make it cleaner. Examples of this ...
0
votes
1answer
598 views

How to send language string in email message body

I am using wp_mail() function to sending email. I have one static string "Hello Admin". My clients wants convert this string to language string. So it possible to convert static string to language ...
0
votes
1answer
1k views

HTML email sent with wp_mail shows plain text

I have an HTML invoice that I want to send. I use the following function to replace some things in the HTML foreach($variables as $key => $value){ $template = str_replace('{{ '.$key.' }}', $...
0
votes
1answer
605 views

Wp_Mail and Contact Form 7

I have a problem. I've used add_filter('wp_mail_from', 'new_mail_from'); add_filter('wp_mail_from_name', 'new_mail_from_name'); function new_mail_from($old) { return 'contact@mysite.hk'; } ...
0
votes
1answer
462 views

Help with filter for wp_notify_moderator()

I have a case where I have multiple Administrators. Not all of them want to be notified per email when there was a comment posted or is held for moderation. The Settings > Discussion page only ...
0
votes
1answer
4k views

wp_mail strips out the link url from the anchor tag in mail content

When the email content contains a link with url like: mobileappname://accesstoken#w34rdgtsrt5v6m, <a href="mobileappname://accesstoken#w34rdgtsrt5v6m">Click</a> wp_mail function removing ...
0
votes
1answer
1k views

wp_mail - using a custom field value for $to

I'm trying to pass a custom field value to my functions.php file. I want to replace: $to = get_bloginfo( 'admin_email' ); to something along the lines of: $to = get_custom_field('sendto', TRUE); ...
0
votes
1answer
4k views

resend user login & password with custom button

How would you resend the login & password to a user who has forgotten his password? In this case they don't want to go to the "password" forgotten page. Additional Q: Mass re-sending of ...
0
votes
1answer
154 views

Sending a custom form data in email through WP Mail Function

Before posting this post I have browsed these resources: On form submission how to send 2 email to different users https://stackoverflow.com/questions/17157685/php-redirect-to-another-page-after-...
0
votes
2answers
40 views

add_action( 'publish_pelicula', 'post_published_notification', 10, 2 ); does not trigger propperly

I'm trying to send an Email before a post "type:pelicula" is submited, but it does not enter to the function post_published_notification, here is the code: <?php /** * Plugin Name: VRlife Alertas ...
0
votes
1answer
57 views

wp_mail doesn't work when logged in?

I am having trouble with a wp_mail function I created, which sends an email when I press a button. It does work great when you do this logged out. But as soon as I am logged in it stops working. It is ...
0
votes
1answer
205 views

Attach a external file as attachement using wp_mail

I am trying to attach external file link (doc file) as attachment but not able to so .. no attachment is being attached.. $email_attachment = array('https://ucarecdn.com/8aa17c61-bd55-4311-8b45-...
0
votes
1answer
27 views

Allow user to add the php code in wp_mail()

I have an email triggered like below. I want a user to be able to customize the content. I want to provide the user to be able to put esc_html($user->display_name) somehow may some thing with a ...
0
votes
1answer
49 views

Sending HTML email containing custom fields to site users from WordPress

I am looking to send out emails to users in my WordPress site/system. I want to have emails that say something like: You have X credits remaining to fulfill Y. Your deadline is Z. X,Y,Z would be ...
0
votes
1answer
856 views

Pass return-path additional parameter in wp_mail

Our server is currently automatically setting the return path as {serverusername@serverhostname.tld}. When sending an email in PHP, I can override this by doing the following: $return = '<bounce@...
0
votes
1answer
2k views

How to send email from contact page without using a plugin

How can I send an email from a contact page in WordPress without using a plugin? Does WordPress have a default function by which I can send email?
0
votes
1answer
2k views

Send notification email to admin for every new post published

I want to send email to admin for every new post published. I am using hook add_action('publish_post' 'custom_send_admin_email'); But above hook sends email if any update is made in post as well ...
0
votes
1answer
3k views

How to send multiple email to different addresses

I know this is already a common question, i tried to google it. but its not helping. i tried to play with the codes but still not working. <tr> <th><label>Admin ...
0
votes
1answer
503 views

Different SMTP based on domain

I have a multi-domain wordpress site, set up so that https://example1.com and https://example2.com both work and show the same content (but with the address bar showing whichever domain was used). I ...
0
votes
1answer
291 views

Error using wp_mail inside custom function

I have this function that sends various emails for me: function tps_send_email($emailTo, $subject, $content) { //Allow HTML in email function tps_set_html_email_content_type() { ...
0
votes
1answer
482 views

wp_mail ignores the name in From field

I am trying to set custom From name and email in wp_mail headers but somehow, wp_mail ignores the name but gets the email correctly. This is the headers code I am using. $headers = array( '...
0
votes
1answer
246 views

Sending mail not working correctly

SITUATION I have a reserve system for a restaurant and I'm trying to send data out of my wpdb to myself with the mail() function around 3pm. So I get a overview of all the reservations for the current ...
0
votes
1answer
113 views

Create a notification for post field

I have a post type quote with custom fields, I would like to create a notification that send an email reminder to the email address set. It reminder is sent when the dates condition matches. I wrote ...
0
votes
1answer
531 views

Send Weekly Email if Users have not complete their profiles

I've created a function to send an email each week, but it doesn't seem to work and I don't know why. In addition I have several doubts because of my lack of experience with wp_cron and wp_mail, so ...
0
votes
1answer
681 views

Is there a way getting post fields using `transition_post_status`

First I tried fetching post_meta data, and latest, I tried fetching get_post_field() inside a transition_post_status hooked function, like: <?php add_action( 'transition_post_status', '...
0
votes
1answer
119 views

Condition within single.php to send an email to the post author

I have this piece of code (below) that checks if the post was modified within the past 7 days. I'd like another piece of code that I can insert where "Needs Updating" is that will send a basic email ...
0
votes
1answer
30 views

trigger email when post is published by someone a user follows

I'm trying to send an email to all users who are following a certain post author when they publish a post. I have this function below, but does not seem to work. a few notes the meta value = '...
0
votes
1answer
1k views

wp_mail issue with sending PDF

I have a problem with wp_mail and sending a PDF. The code below occasionally works and when it does, you can only see the message content within the iPhone, and not Yahoo or Gmail. function ...
0
votes
3answers
2k views

Wp_mail() function not working in Windows and MAC OS

Not getting mails when sent from Windows OS and MAC OS but getting when sent from Linux OS. I tried sending mails from LINUX OS,Windows and MAC OS LINUX sending me the mails as it should do but ...
0
votes
1answer
950 views

wp_mail() won't send mail when it's a variable, only when hard coded

I have coded a "follow post" script to which I wanna add the functionality of sending the user an email if a post they have followed has been updated. My script only sends an email if I hardcode an ...
0
votes
2answers
1k views

Contact form - ajax, wp_mail

I'm trying to create a simple contact form using jQuery to validate the form and AJAX to pass it to PHP and WP wp_mail() to send it. I have a simple form like this. <form role="form"> ...
0
votes
1answer
792 views

wp_mail BCC admin

This code does exactly what I want, but I want to add the username of the author of the post. // BCC Admin if (get_option('jr_bcc_apply_emails')=='yes') : wp_mail( get_option('admin_email'), __('[...
0
votes
1answer
406 views

How can I format email notification after registration?

I saw already this answer. And it helped me to make unique mail. It's great. But how to format some text using HTML? For example to work with tags <b> <i> <font color="red"> <...
0
votes
1answer
675 views

Send email for confirmation during user registration

I am very new to WP.How does a confirmation mail is sent during user registration.Is there any services being worked out here. is this a free service using php for any plugin.
0
votes
1answer
681 views

How to get post meta in functions?

I set an email button in functions php. The email is sent when clicking on a front-end update post button. The problem is: the email is sent but I can't get the post title to appear in the post. I ...
0
votes
2answers
793 views

wp_mail - using a custom field value

Can this work? I want to send a email when a post is published to the recipient, that is called in custom field. EDIT I changed the code to another example I found. function wpr_Notification($...
0
votes
1answer
232 views

Send email to admin with post author

I'm using the following to send an email to the admin when a post is publish by an author: add_action('publish_post', 'send_admin_email'); function send_admin_email($post_id){ $to = 'admin@email....
0
votes
1answer
3k views

Images in wp_mail not showing

I created a plugin that sends an email: $subject = 'New comment - '.$post_title; ob_start(); include(SUBSCRIBE_USER_BASE_DIR . '/email/message.php'); $message = ob_get_clean(); ...
0
votes
1answer
4k views

Why is wp_new_user_notification not working?

I don't like to use a plugin so I made use of user registration custom signup page and it's not sending any emails. At first everything was working. Then I added some functions to change the "from" ...
0
votes
1answer
428 views

Conditional wp_mail statement on post

I am currently posting from the front end using a similar model as http://voodoopress.com/2011/03/review-of-posting-from-front-end-form/. I want to send an email to certain addresses based on the ...
0
votes
0answers
4 views

wp_mail function not working in WordPress Plugin Boilerplate

I am creating a plugin using WordPress plugin boilerplate (https://wppb.me/), I have create a separate file for sending emails under /admin/partials/ directory. but wordpress throw error when I am ...
0
votes
0answers
13 views

Sending bulk mail to a certain number of users

We would like to send bulk mail to the user list using wp_mail() function. Is it possible to send e-mail to users at a certain time (similar to newsletter plugins)? For example, dividing the list of ...
0
votes
2answers
37 views

Including user data in “new user notification email”

I'm trying to create a function that sends an email to the admin when a new user registers. I would like the email to contain the users first name, last name, email address, and billing information ...
0
votes
1answer
27 views

Can't change headers / From for wp_mail()

i tried nearly anything to change the From / Reply-to name for the wp_mail() function. Here is my code: $headers = "From: \"FROM NAME\" <from-mail@from.com>\n"; $headers .= "Return-Path: <...
0
votes
1answer
25 views

Send a email base on a taxonomy term

I like to have a email send if a custom post is created/updated if it has custom taxonomy term. The here is the CPT, taxonomy and term. Custom Post Type: Call Custom taxonomy: call_type Custom ...
0
votes
0answers
44 views

Contact form with file upload

I'm trying to create a contact form that lets users upload files. This is the PHP code I have: function ajax_contactform_action_callback() { $error = ''; $status = 'error'; if (empty($_POST['name']...
0
votes
1answer
28 views

Add multiple recipients via BCC on wp_mail()

I created a function which returns an array of email addresses: // returns all wanted email adresses leweb_get_events_detail(); This is the given array: Array ( [0] => mail@example.com [...