Skip to content

Instantly share code, notes, and snippets.

@davidfcarr
Created July 8, 2023 16:21
Show Gist options
  • Save davidfcarr/7e6ed391d2f9332894275829ffe4dcc1 to your computer and use it in GitHub Desktop.
Save davidfcarr/7e6ed391d2f9332894275829ffe4dcc1 to your computer and use it in GitHub Desktop.
//adds intval sanitization
if(!empty($_POST['resend']))
{
echo '<div class="notice"><p>Resending email requesting confirmation</p></div>';
$mail['from'] = get_option('admin_email');
$mail['fromname'] = get_option('blogname');
$mail['subject'] = 'Please confirm your subscription to the email list for '.$mail['fromname'];
foreach($_POST['resend'] as $id) {
$sql = "select email from $table where id = ".intval($id);
$mail['to'] = $wpdb->get_var($sql);
$confirm = site_url('?rsvpmail_subscribe='.$mail['to']);
$mail['html'] = "<p>We have your email list signup on file but need confirmation before we can add you to our active list.</p>";
$mail['html'] .= sprintf('<p>Please <a href="%s">confirm your subscription</a> to the email list.</p><p>Follow this link to confirm<br><a href="%s">%s</a></p><p>If you did not initiate a subscription request, please ignore this note and accept our apologies.</p>',$confirm,$confirm,$confirm);
rsvpmailer($mail);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment