/** * @since 3.0.2 */ public function send_verification_email($ad) { $mail = new AWPCP_Email(); $mail->to[] = awpcp_format_email_address($ad->ad_contact_email, $ad->ad_contact_name); $mail->subject = sprintf(__('Verify the email address used for Ad "%s"', 'AWPCP'), $ad->get_title()); $verification_link = awpcp_get_email_verification_url($ad->ad_id); $template = AWPCP_DIR . '/frontend/templates/email-ad-awaiting-verification.tpl.php'; $mail->prepare($template, array('contact_name' => $ad->ad_contact_name, 'ad_title' => $ad->get_title(), 'verification_link' => $verification_link)); if ($mail->send()) { $emails_sent = intval(awpcp_get_ad_meta($ad->ad_id, 'verification_emails_sent', true)); awpcp_update_ad_meta($ad->ad_id, 'verification_email_sent_at', awpcp_datetime()); awpcp_update_ad_meta($ad->ad_id, 'verification_emails_sent', $emails_sent + 1); } }
public function mark_reviewed($listing) { if (awpcp_update_ad_meta($listing->ad_id, 'reviewed', true)) { awpcp_flash(sprintf(__('The listing was marked as reviewed.', 'AWPCP'), esc_html($recipient))); } else { awpcp_flash(sprintf(__("The listing couldn't marked as reviewed.", 'AWPCP'), esc_html($recipient))); } return $this->redirect('index'); }
public function set($listing_id, $name, $value) { return awpcp_update_ad_meta($listing_id, $name, $value); }