/** * @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); } }
/** * @since 3.0.2 */ function awpcp_ad_renewed_user_email($ad) { $mail = new AWPCP_Email(); $mail->to[] = awpcp_format_email_address($ad->ad_contact_email, $ad->ad_contact_name); $mail->subject = sprintf(get_awpcp_option('ad-renewed-email-subject'), $ad->get_title()); $introduction = get_awpcp_option('ad-renewed-email-body'); $template = AWPCP_DIR . '/frontend/templates/email-ad-renewed-success-user.tpl.php'; $mail->prepare($template, compact('ad', 'introduction')); return $mail; }
/** * @since 3.0.2 */ function awpcp_ad_updated_user_email($ad, $message) { $admin_email = awpcp_admin_recipient_email_address(); $mail = new AWPCP_Email(); $mail->to[] = awpcp_format_email_address($ad->ad_contact_email, $ad->ad_contact_name); $mail->subject = sprintf(__('Your Ad "%s" has been successfully updated', 'AWPCP'), $ad->get_title()); $template = AWPCP_DIR . '/frontend/templates/email-ad-updated-user.tpl.php'; $mail->prepare($template, compact('ad', 'message', 'admin_email')); return $mail; }