This commit is contained in:
ThemeLexus
2019-09-30 16:28:04 +07:00
parent d8a0462533
commit 1d8c6dd6f8
18 changed files with 228 additions and 30 deletions

View File

@@ -28,7 +28,11 @@ class OpalEstate_Send_Email_Approve extends OpalEstate_Abstract_Email_Template {
*/
public function get_subject () {
$propety_title = '' ;
return sprintf( esc_html__( 'New Property Listing Submitted: {property_name}', 'opalestate-pro' ), $propety_title );
$subject = sprintf( esc_html__( 'The Property Listing Approved: {property_name}', 'opalestate-pro' ), $propety_title );
$subject = opalestate_options( 'approve_email_body' , $subject );
return $subject;
}
/**
@@ -58,7 +62,9 @@ class OpalEstate_Send_Email_Approve extends OpalEstate_Abstract_Email_Template {
*
*/
public function get_content_template() {
return opalestate_load_template_path( 'emails/request-reviewing' );
$content = opalestate_options( 'approve_email_body' , self::get_default_template() );
return $content;
}
/**

View File

@@ -31,11 +31,17 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ
public function get_subject () {
switch ( $this->type ) {
case 'enquiry':
$subject = html_entity_decode( esc_html__('You got a message enquiry', 'opalestate-pro') );
$subject = opalestate_options( 'enquiry_email_subject', $subject );
break;
default:
$subject = html_entity_decode( esc_html__('You got a message contact', 'opalestate-pro') );
$subject = opalestate_options( 'contact_email_subject', $subject );
break;
}
@@ -46,14 +52,12 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ
* Send Email
*/
public function get_content_template() {
switch ( $this->type ) {
case 'enquiry':
return opalestate_load_template_path( 'emails/enquiry' );
return opalestate_options( 'enquiry_email_body', self::get_default_template( 'enquiry' ) );
break;
default:
return opalestate_load_template_path( 'emails/contact' );
return opalestate_options( 'contact_email_body', self::get_default_template( ) );
break;
}
}
@@ -70,5 +74,15 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ
$this->args['email'] = $this->args['receiver_email'];
return parent::get_body();
}
/***/
public static function get_default_template ( $type='contact' ) {
if( $type == 'enquiry' ) {
return opalestate_load_template_path( 'emails/enquiry' );
}
return opalestate_load_template_path( 'emails/contact' );
}
}
?>

View File

@@ -62,8 +62,7 @@ class OpalEstate_Send_Email_New_Submitted extends OpalEstate_Abstract_Email_Temp
*/
public function get_content_template() {
$body = opalestate_get_option( 'newproperty_email_body', self::newproperty_email_body() );
$body = opalestate_get_option( 'newproperty_email_body', self::get_default_template() );
return $body;
}
@@ -103,7 +102,6 @@ class OpalEstate_Send_Email_New_Submitted extends OpalEstate_Abstract_Email_Temp
* Send Email
*/
public function get_body() {
return parent::get_body();
}
}

View File

@@ -29,14 +29,18 @@ class OpalEstate_Send_Email_Request_Reviewing extends OpalEstate_Abstract_Email_
public function get_subject() {
$propety_title = '';
return sprintf( esc_html__( 'You have a message request reviewing: %s at', 'opalestate-pro' ), $propety_title );
$content = sprintf( esc_html__( 'You have a message request reviewing: %s at', 'opalestate-pro' ), $propety_title );
$content = opalestate_options( 'request_review_email_subject', $content );
return $content;
}
/**
* Send Email
*/
public function get_content_template() {
return opalestate_load_template_path( 'emails/request-reviewing' );
$content = opalestate_options( 'request_review_email_body', self::get_default_template() );
return $content;
}
/**
@@ -65,4 +69,9 @@ class OpalEstate_Send_Email_Request_Reviewing extends OpalEstate_Abstract_Email_
return parent::get_body();
}
public static function get_default_template() {
return opalestate_load_template_path( 'emails/request-reviewing' );
}
}