Filters to Customize Vantage Emails

This is an advanced documentation intended for website developers. In this documentation you will find the information needed to customize the emails sent from the Vantage AppTheme. These filters give you the ability to fully customize the emails.

Notification Filter Code

This is the code you will need to add to the Vantage theme to use the notification filters.

/**
* Filter the Listing standard notifications.
*
* The dynamic portions of the hook name, `$id`, refer to the particular
* notification type.
*
* @since 1.0
*
* @param array $args An array of wp_mail() arguments, including the
*  "to", "subject", "message", "headers",
*  "attachments" and other custom values (for ex. "listing" and "order").
*/
$args = apply_filters( "appthemes_{$id}", $args );

Notification Filters

These parameters can be used in the code above for the $args variable.

  • $args['to'] – Array or comma-separated list of email addresses to send message.
  • $args['subject'] – Email subject
  • $args['message'] – Message contents
  • $args['headers'] – (optional) Email headers
  • $args['attachments'] – (optional) email attachments, empty by deafult
  • $args['listing'] – (optional) Instance of WP_Post object of current item
  • $args['order'] – (optional) Instance of APP_Order object of current transaction

These filters can be used to replace the ($id)

  • notify_user_expired_addon – notification to user when his listing addon has expired
  • notify_user_rejected_claim – notification to user when his listing claim has been rejected
  • notify_user_approved_claim – notification to user when his listing claim has been approved
  • notify_admin_pending_claimed_listing – notification to admin about new pending claimed listing
  • notify_user_pending_claimed_listing – notification to claimee about pending claimed listing
  • notify_user_expired_listing – notification to user when his listing has expired
  • notify_admin_failed_transaction – email notification to admin if payment failed
  • send_user_receipt – email with receipt to customer after completed purchase
  • notify_admin_pending_listing – email to admin about new pending listing
  • notify_user_pending_listing – email to user about his new pending listing
  • notify_user_approved_listing – email to user when their listing has been approved
  • notify_admin_publish_listing – email to admin after listing has been published
  • notify_user_publish_listing – email to user after listing has been published
  • notify_admin_renewed_listing – email to admin after listing has been renewed
  • notify_user_renewed_listing – emails to user after listing renewed

Usage Example:

For example we want to change the content of the listing expired email.

notify_user_expired_listing. Prepend appthemes_ to get the filter name: appthemes_notify_user_expired_listing

function my_custom_notify_user_expired_listing( $args ) {

$blogname    = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
$post        = $args['listing'];
$recipient   = get_user_by( 'id', $post->post_author );
$permalink   = html_link( get_permalink( $post ), $post->post_title );
$listing_mod = APP_Listing_Director::get( VA_LISTING_PTYPE );
$renew_link  = html_link( $listing_mod->view_process_renew->basic_url( $post->ID ) );

// Change the Subject.
$args['subject'] = sprintf( __( '[%1$s] Ohhh No! Listing "%2$s" just has been expired on the %1$s' ), $blogname, $post->post_title );

// Change content.
$args['message'] = <<<EOT
<h1>Hey {$recipient->display_name}!</h1>
<p>We just letting you know that Your listing: "$permalink" has been expired (it is not visible to the public anymore).</p>
<h2>Make Your listing great again!</h2>
<p>Renew and re-publish it again using following link: $renew_link</p>

Yours,
$blogname team
EOT;

return $args;
}
add_filter( 'appthemes_notify_user_expired_listing', 'my_custom_notify_user_expired_listing' );
Your rating: none
Rating: 3.5 - 2 votes

Popular Add-ons

CP-Tabber

Show specific custom fields as tabs on an ad detail page.


(3)
$12

AppThemes Coupons

Start offering coupons and promotions to your customers.


(15)
$29

Vantage Custom Emails

Customize your Vantage emails


(4)
$19