Set update_user_meta()
for a WP_User
if get_user_meta()
ends up empty.
Update a key with a future date for the next year:
$startDate=date('Y-m-d');
$futureDate=date('Y-m-d', strtotime('+1 year', strtotime($startDate)) );
Schedule an event in one year with wp_schedule_event()
or use 'daily'
to check all users for a relative year date.
// WP_User_Query arguments
$args = array (
'meta_query' => array(
array(
'key' => 'future_email_date',
'value' => date('Y-m-d'),
'compare' => '<=',
'type' => 'DATETIME',
),
),
);
// The User Query
$user_query = new WP_User_Query( $args );
When you find a match, use wp_mail()
to send your email.
Related Posts:
- SMTP connect() failed PHPmailer – PHP
- What is the difference between ports 465 and 587?
- Email validation in Ruby on Rails?
- Do something after sending email
- How do I customise the new user welcome email
- How do you update user_email on the front end in WP 3.3?
- User Without Email?
- Email confirmation on registration
- Customizing lost password email
- Create custom welcome email without a plugin
- How do i send mail with custom Form Data using WordPress
- Email as Username in registration
- Fwd: [Website Name] Notice of Email Change [closed]
- Send all WPMU emails via SMTP
- Locked out of my own blog and password reset not working
- email wordpress users using BCC
- email sends from [email protected] even though I have it set to something else
- How to add line breaks to $email[‘body’] when using auto_core_update_email hook
- How to sent one form values to 2 different sites in wordpress
- General Setting Allow Multiple Email Notification
- How to validate website field in contact form 7?
- Trigger WordPress Actions from Email?
- How to change WordPress email notification sender?
- Contact form sender email
- WordPress Add New User – Send an Activation Email
- Send email only upon draft
- wordpress do not let user registered with info@ email and other reserved emails to get registered by users
- Emails marked as spam because it’s contain via box4231.bluehost.com
- How to change the text of automatic E-Mails e.g. after changing your password? (German localization)
- Limit number of emails per second
- WordPress reset password email is not working – woocommerce and checkmail does work
- Throttling email frequency
- User registration email and let user choose pasword
- Correctly configure SPF/DMARC record to work with WordPress [closed]
- Share pdf with a friend via email [closed]
- 2 Email addresses for each user
- Emailing passwords: Setup installed on home server using XAMPP
- Mail function is not working
- How to set up a simple email subscription?
- PAGE Specific Email Notifications
- Email user on WordPress upgrade
- Send bulk emails without timeout
- How to send post notification when a Author and Contributor post?
- Change the Sender(not From) on wp_mail() function [closed]
- Prevent sending emails on user creation in OOP context?
- Is Postfix required for WordPress contact forms in general?
- Mailing list sign up form without plugin
- Retrieve duration since sign up
- Adding “reply-to” in the email [closed]
- WordPress Won’t Send Email When a User Register
- Is it possible to not receive email notifications for comments?
- How do I troubleshoot registration/password email errors?
- Confirmation required on users email change
- Email address used by website but I do not know where
- wp_mail not sending email on custom function
- Changing wordpress admin email [closed]
- Change email address change notice from WordPress
- Getting image in mail
- Send email daily using `wp_mail`
- How to send confirmation email after payment made via paypal?
- WP stopped emailing notifications about new comments
- How to prevent the scheduling of the same event on the same day
- How to change the format of the subcriber email
- wp_mail() won’t send mail when it’s a variable, only when hard coded
- WordPress and IPN problem
- Send email for confirmation during user registration
- I just had an email from wordpress. what does it mean?
- Alternative to email notification system?
- About Custom Email Template Design Responsive
- How to recover one of WP email addresses?
- Send email using wordpress plugin on behalf of someone with their permission
- How to apply a function to the value $email of get_user_by to override email_exists?
- Use [from-email] from the contact form as sender’s email
- wp_mail send multiple emails in a loop
- Can’t change headers / From for wp_mail()
- forgot password page with expiry link email of 60 minutes
- New user notification issue
- E-Mail Notification on post edit
- I need to verify emails when users signup
- Why do WordPress emails to multiple recipients include \n in the list
- Where is the account email address located?
- SMTP not working for Comments Email Notifications
- wordpress wp mail not changing sender mail
- How can I send an email 24 hours after first email?
- WordPress doesn’t send SMTP email even by phpmailer hook
- Whitelist email sent by WordPress
- Asynchronous emailing
- delete of @ in emailaddress when starting unsubscribe link in url
- Showing “diaplay_name”
- Send Custom Post Notification to Followers
- Get emails of register user in WordPress
- Send email from WordPress
- Email setting in wordpress
- Create WP account from an external email form submission?
- Display “a generated one [avatar] based on their e-mail address”
- Allow users to register as a higher role than default with code
- Can wordpress users check GMAIL (G Suite) inbox & send email from their membership account on WordPress? [closed]
- Choose from different emails for different purposes
- WordPress wp_mail not working on a few pages
- Admin email value stuck in database?