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 expirednotify_user_rejected_claim
– notification to user when his listing claim has been rejectednotify_user_approved_claim
– notification to user when his listing claim has been approvednotify_admin_pending_claimed_listing
– notification to admin about new pending claimed listingnotify_user_pending_claimed_listing
– notification to claimee about pending claimed listingnotify_user_expired_listing
– notification to user when his listing has expirednotify_admin_failed_transaction
– email notification to admin if payment failedsend_user_receipt
– email with receipt to customer after completed purchasenotify_admin_pending_listing
– email to admin about new pending listingnotify_user_pending_listing
– email to user about his new pending listingnotify_user_approved_listing
– email to user when their listing has been approvednotify_admin_publish_listing
– email to admin after listing has been publishednotify_user_publish_listing
– email to user after listing has been publishednotify_admin_renewed_listing
– email to admin after listing has been renewednotify_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' );